-
Notifications
You must be signed in to change notification settings - Fork 9
Tutorial/cascade delete #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
``` | ||
|
||
<Note> | ||
An important thing to note is that the local SQLite database will always match the online database, as long as the tables are in the publication, when online. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"online database" is a bit confusing - can we say backend database to be more consistent with how we refer to it across docs?
|
||
<Note> | ||
An important thing to note is that the local SQLite database will always match the online database, as long as the tables are in the publication, when online. | ||
For example, if you delete a record from the `lists` table and Supabase cascade deletes a record from the `todo` table, PowerSync will also delete the `todo` record when online. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth explicitly saying "local lists table" and "local todo record" if that's correct. Basically make clear when we're taking about records in the SQLite database vs backend database
</Note> | ||
2. Implementing triggers (which is more complex) | ||
<Note> | ||
You create triggers on the internal tables (not the views defined by the client schema), similar to what is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth linking to https://docs.powersync.com/architecture/client-architecture#schema so they can get more details about the internal tables vs views thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR introduces a tutorial that shows how to perform a cascading delete on the client.