electric-sql / pglite

Lightweight WASM Postgres with real-time, reactive bindings.
https://pglite.dev
Apache License 2.0
9.46k stars 204 forks source link

feat: PGlite-sync naive resumability #341

Closed msfstef closed 1 month ago

msfstef commented 1 month ago

Creates a meta table for storing shape subscription information - uses a provided shapeKey to determine whether it should persist things and how to index the persisted shapes.

I started by automatically persisting based on things like the shape definition and the table it syncs into, but like @samwillis probably had already figured out there's complexities in mapping the shape etc that makes it hard to automatically infer how to persist it.

I propose keeping the option undocumented until we get reference counting as well, but for now adding a shapeKey would persist the shape and reset the table naively when needing to refetch.

github-actions[bot] commented 1 month ago

Built bundles:

github-actions[bot] commented 1 month ago

🚀 Deployed on https://66f3e98c9c487448484f1494--pglite.netlify.app

samwillis commented 1 month ago

@msfstef This is all really awesome!! Only those two comments.