Closed ryzencool closed 2 months ago
Same here — I’m using Expo/SQLite and Drizzle. From what I understand, some integration might be needed. For instance, Drizzle would likely require a feature or middleware to sync with Electric.
You use ShapeStream
— https://next.electric-sql.com/api/clients/typescript#shapestream
It lets you subscribe to the stream of updates to the shape which you can then apply to the local db. Reading through the Redis example might help: https://github.com/electric-sql/electric/blob/main/examples/redis-client/src/index.ts
Here is how we did for PGlite. The code for SQLite should be quite similar. https://github.com/electric-sql/pglite/blob/main/packages/pglite-sync/src/index.ts
I read the document, but now I confused how electric-next sync data into local database, http api get the data and then how to update data in the local database?