You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b5ffe20
Browse filesBrowse the repository at this point in the historyBrowse files
Give InMemoryModelStorage the same relationship-materialization and partial-update behavior as SQL/Core Data
insert() now merges into an existing row instead of replacing it outright, so
providing only some attributes/relationships preserves whatever the row already
had for the rest — the same "only touch the columns you provided" semantics a
SQL ON CONFLICT DO UPDATE or a Core Data managed object gives for free. Without
this, re-inserting a row from a batch that doesn't touch every relationship
(e.g. a catalog sync that doesn't restate reservations written by an unrelated
flow) silently wiped those links.
fetch() now materializes every to-many relationship the schema declares, the
way a SQL row or a Core Data managed object does automatically on read. Neither
backend actually stores a to-many value on the row that owns it: a one-to-many
(whose inverse is a to-one foreign key) is answered by scanning the destination
table for rows whose foreign key points back, and a many-to-many (whose inverse
is also to-many) by a join table either side can add a link to. This store kept
only what insert() was given, with no such derivation — a to-many relationship
that's supposed to be entirely computed and never assigned (which describes
every one-to-many) always decoded as either an empty collection regardless of
what actually pointed to it, or keyNotFound if nothing had ever touched that
key at all. Both are now derived correctly. To-one relationships are left
alone: an absent required reference is a real problem, not a default.
0 commit comments