electric-sql / pglite

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

feat: `electric.syncing = true` config flag during a sync #392

Closed samwillis closed 1 month ago

samwillis commented 1 month ago

Set an electric.syncing config flag in Postgres during a sync transaction to enable user defined triggers to chose how to run during a sync

github-actions[bot] commented 1 month ago

Built bundles:

github-actions[bot] commented 1 month ago

🚀 Deployed on https://670e2de4e3e68c7f83cfe53a--pglite.netlify.app

samwillis commented 1 month ago

@msfstef Yes, so you can configure your own merge logic in triggers that know is the transaction is originating from a sync or a local change. Will allow mutating the synced table directly with local changes.