Read path
PostgreSQL -> ElectricSQL -> PGlite. Shapes (including membership fan-out via subquery
where) stream into local PGlite. Reads never hit Electric directly — they go through the
shape proxy, which enforces ownership.
pgxsinkit is the @pgxsinkit/* library set. It gives a local-first app a read path that
streams Postgres rows to PGlite through ElectricSQL, and a write path that takes local edits back
to Postgres through a typed write route — with per-row access control on both (Postgres row-level
security on writes, a matching shape filter on reads).
Read path
PostgreSQL -> ElectricSQL -> PGlite. Shapes (including membership fan-out via subquery
where) stream into local PGlite. Reads never hit Electric directly — they go through the
shape proxy, which enforces ownership.
Write path
client -> write route -> PostgreSQL. Edits are staged locally, flushed as a batch, and applied
in a single in-database PL/pgSQL function — one path, no per-table CRUD.
Tested against real infrastructure
A container-backed integration + performance harness runs every path against real PostgreSQL, ElectricSQL, and PGlite — not mocks — so the toolkit’s behaviour is proven, not asserted.
AI-ready
These docs publish llms.txt, and the @pgxsinkit/* packages ship
TanStack Intent Agent Skills — version-pinned guidance your
coding assistant can load to wire sync correctly. See
Use these docs with your AI assistant.