-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Description
When using Brick’s subscriptions, changes to a table only fire when rows are inserted/updated in that table. If you create a related object indirectly by only inserting rows into a join or child table, the subscription on the parent table does not trigger.
Example (conceptual):
- You have a
Parenttable and aChildtable with a foreign key toParent. - You subscribe to Parent changes:
appDB.subscribe<Parent>().listen((parents) {
print("Parent updated!");
});- Instead of inserting a row into
Parentdirectly, you insert only intoChildwith a reference to a new parent ID.
final parent = Parent(id: "p1", name: "Parent A");
await appDB.upsert<Child>(Child(id: "c1", parent: parent));Observed behavior:
The subscription on Parent never fires.
Expected behavior
Subscriptions on Parent should ideally detect changes to related children if the parent object is conceptually modified.
Metadata
Metadata
Assignees
Labels
No labels