Replies: 1 comment
-
|
Hey @dgllghr, The write_id in the write patterns example is used to identify the local write when it syncs back into the client that made it. If you have some other identifier or the transaction ID to work with then that's great and you don't need it. In TanStack DB, we've refined the pattern and do use the transaction ID and per e.g.: https://electric-sql.com/blog/2025/07/29/local-first-sync-with-tanstack-db#write-path-sync |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am having trouble understanding why it is necessary to identify each write with a
write_idin through-the-database sync. My reasoning is this: each write to a row can store the whole state of the row at write time in thechangestable. The example in the documentation is storing the transaction ID (pg_current_xact_id()) associated with the write so all writes in the same transaction can be grouped together. Since all the whole row is being saved, peers only need to see the last write to any row for a given transaction. So I am having trouble understanding why thewrite_idis necessary. What am I missing?Beta Was this translation helpful? Give feedback.
All reactions