How can I efficiently sync rows in my /api/shapes/users table?
#2702
Unanswered
khabubuphathu
asked this question in
Questions
Replies: 1 comment
-
|
If you modify the WHERE IN clause and add a new id, you'll be creating a new shape with a new initial sync state. It's not possible to do a continuation from a previous shape using the offset, since htey have different initial snapshots. Maybe you could sync multiple shapes with the new ids during a live sessions? When the client reconnects you'd re-query the initial WHERE IN clause for the user. |
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.
-
How can I efficiently sync rows in my /api/shapes/users table for users in my workspace using ElectricSQL? Specifically, I want to use the offset query parameter to fetch users in smaller increments instead of retrieving the full list every time.
For context, I have a proxy that applies custom logic to determine which columns and rows must be synced to the client. When syncing the users table, I fetch a list of user IDs relevant to the requester and apply this list in a WHERE clause (id IN (id1, id2, ...)). This works well for the initial sync, but in live mode, how can I incorporate the offset query parameter to avoid re-fetching the entire list of IDs?
Beta Was this translation helpful? Give feedback.
All reactions