Conversation
Refactor destination-postgres to support both pg.Pool and PGlite as
backends. PGlite enables in-process WASM Postgres for testing without
Docker and lightweight embedded deployments.
- Add QueryClient/ManagedClient abstractions (src/client.ts)
- Add `pglite` config option (true for in-memory, {data_dir} for persistent)
- Refactor writeMany/upsertMany/deleteMany to accept QueryClient interface
- Add @electric-sql/pglite as optional peer dependency
- Add PGlite-specific test suite (no Docker required)
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Committed-By-Agent: claude
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
…rt, upgrade to pglite 0.4.5 - Add `allow_experimental_pglite` boolean config gate - Detect file:// and memory:// URL schemes and route to PGlite - Upgrade @electric-sql/pglite from 0.2.17 to 0.4.5 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
PGlite's query() rejects multiple SQL statements in a single call. Fall back to exec() when the "multiple commands" error is detected. This fixes destination setup which uses buildCreateTableDDL (returns a DO block + standalone DO blocks). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
…ite files Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
…tgres Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
…n process kill Prevents data directory corruption when the process receives SIGTERM/SIGINT mid-write. PGlite lacks WAL recovery, so unclean shutdown corrupts the data dir. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
Runs the sync engine entirely in-browser with PGlite at memory://, including live WebSocket updates from Stripe. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
Uses vite-plugin-node-polyfills for node:* builtins, plus custom shims for pg, ws, child_process, https-proxy-agent, and logger. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
Add custom resolveId plugin for node: imports from linked workspace dist files, add process globals injection, and node:url shim. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
- engine: add ./lib export (core without API/CLI node deps) - destination-postgres: add ./pglite export (no pg import) - util-postgres: add ./sql and ./upsert sub-path exports - browser-sync: use new sub-paths to avoid node:fs, pg, etc. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Committed-By-Agent: claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client-pg.tsandclient-pglite.tsfiles with sharedManagedClientinterfacebrowser-syncexample app: React + Vite that runs the full sync engine in-browser with PGlite atmemory://and live WebSocket updatesallow_experimental_pgliteconfig flagdevbranch, only tag DockerlatestonmainTest plan
pnpm testpasses for destination-postgres (PGlite unit tests)cd examples/browser-sync && pnpm dev— app starts, enter Stripe key, sync runs in-browsersync-engine sync --postgres-url memory:// ...creates PGlite instance and syncs🤖 Generated with Claude Code