You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(pglite): productize adapter + pglite-test for publish
- Make @electric-sql/pglite a peerDependency of @pgpmjs/pglite-adapter and
pglite-test (kept as a pinned devDependency for the monorepo build/tests),
so consumers pin the PGlite version and avoid duplicate installs.
- Harden pglite-test getConnections: restore the previous client factory on
teardown (instead of resetting to default) and unwind seams if setup throws.
- Rename workflow pglite-poc.yaml -> pglite.yaml (job pglite-socket-e2e); it is
the standalone wire-protocol e2e demo. The in-process path already runs in the
no-services unit-tests (pglite) job in run-tests.yaml.
- Add CHANGELOG.md stubs for both new packages.
Copy file name to clipboardExpand all lines: poc/pglite/DESIGN.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ single-writer backend, but is not required for this rollout.
177
177
2.**`@pgpmjs/pglite-adapter`** (in-process driver, all pglite deps here). ✅ **DONE** — `registerPglite()` registers a PGlite-backed `QueryablePool`; 6 tests deploy→verify→revert an unmodified pgpm plan into in-process PGlite (no socket), with `useTransaction: true`.
178
178
2b. **`pgsql-client` client-factory seam** (default = `new pg.Client`; zero behavior change). ✅ **DONE** — `registerPgClientFactory` / `defaultPgClientFactory` / `getActivePgClientFactory`, mirroring the `pg-cache` pool seam; `PgClient` routes its underlying client through it; 4 unit tests. Needed because `pgsql-test`/`pgsql-client` build `pg.Client`s directly rather than via `getPgPool`.
179
179
3.**`pglite-test`** drop-in `getConnections` (instance-per-suite). ✅ **DONE** — composes `registerPglite()` (pool seam) + `registerPgClientFactory` (client seam) so `pg`/`db` share one in-process PGlite session; a `SharedTxn` ref-counter keeps the standard two-client `beforeEach`/`afterEach` savepoint harness working over a single session; seeds via `seed.pgpm()`; no `createdb`/`psql`. 5 tests cover deploy, per-test isolation, and RLS role/JWT switching (incl. `WITH CHECK`). No separate PGlite-aware `DbAdmin` subclass was needed — the instance *is* the database and extension/role bootstrap runs via `pglite.extensionSql`.
180
-
4.This PoC's socket-shim CI job (`pglite-poc.yaml`) is **kept as-is** — it's a standalone, out-of-workspace demonstration of the `pg-gateway` wire-protocol path (own lockfile, published `@pgpmjs/core`). The canonical in-process path is now proven by the `@pgpmjs/pglite-adapter` and `pglite-test` jest suites in `run-tests.yaml` (no-services tier).
180
+
4.The socket-shim CI job (`pglite.yaml`, job `pglite-socket-e2e`) is **kept** — a standalone, out-of-workspace demonstration of the `pg-gateway` wire-protocol path (own lockfile, published `@pgpmjs/core`). The canonical in-process path is proven by the `@pgpmjs/pglite-adapter` and `pglite-test` jest suites in the no-services `unit-tests (pglite ...)` job in `run-tests.yaml`.
181
181
5. (Optional) Core transaction-client fix — only if a *multi-connection* single-writer backend is ever targeted; the in-process adapter does not need it.
182
182
6. (Future) `pgpm init --pglite` scaffolder — CLI-layer convenience; no PGlite dep in core.
0 commit comments