Skip to content

Conversation

HeinrichvonStein
Copy link

This PR introduces a tutorial that shows how to perform a cascading delete on the client.

```

<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.
Copy link
Collaborator

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.
Copy link
Collaborator

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
Copy link
Collaborator

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

@michaelbarnes michaelbarnes self-requested a review December 31, 2024 16:26
Copy link
Contributor

@michaelbarnes michaelbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michaelbarnes michaelbarnes merged commit 605650e into docs Dec 31, 2024
1 check passed
@michaelbarnes michaelbarnes deleted the tutorial/cascade-delete branch December 31, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants