electric icon indicating copy to clipboard operation
electric copied to clipboard

docs: Expo: mention of PGLite issue unclear

Open Hades32 opened this issue 6 months ago • 5 comments

As someone not familiar with the internals of ElectricSQL, it's really unclear what this means:

https://github.com/electric-sql/electric/blob/68ba7ed93495990df1e3b413fd7c4ebb2bae33a8/website/docs/integrations/expo.md?plain=1#L67-L71

Does this mean it just falls back to SQLite, or that we don't get any offline capabilities?

Hades32 avatar Jun 11 '25 13:06 Hades32

cc @thruflo as the original author of that section

Hades32 avatar Jun 11 '25 13:06 Hades32

PGlite doesn't yet work on RN. There's no explicit fallback because Electric isn't tied to a particular client. You could choose to sync into expo-sqlite, or just in memory, or into TanStack DB, etc.

thruflo avatar Jun 11 '25 14:06 thruflo

Are there examples of using a custom local persistence then? It's unclear still to me how much this would limit me in using electric in Expo

Hades32 avatar Jun 11 '25 16:06 Hades32

This is an example using a Valtio store persisted to localStorage https://github.com/electric-sql/electric/tree/main/examples/write-patterns/patterns/3-shared-persistent

https://livestore.dev is a great SQLite based option that works with Electric and React Native.

thruflo avatar Jun 11 '25 18:06 thruflo

Thanks, very much appreciated! Might be worth adding these to the docs, too

Hades32 avatar Jun 11 '25 20:06 Hades32