/** * A `PgExecutor` over @electric-sql/pglite (embedded WASM Postgres). * * This is the **test/dev** driver — hermetic, no docker, runs under bun. * `@electric-sql/pglite` is a devDependency of `@syncular/server`; this * module is exported for tests and local experiments, not the production * path. Production wires Bun.sql or node-postgres against the same * `PgExecutor` interface (see the server README). * * pglite is single-connection, so `transaction` runs `BEGIN`/`COMMIT`/ * `ROLLBACK` on the one connection. Overlapping `transaction` calls are * serialized through a promise chain (mirroring `SqliteServerStorage`'s * begin() FIFO): a nested BEGIN on Postgres is a warning-level no-op, so * interleaved scopes would silently collapse into one SQL transaction and * break the push layer's serialization guarantee on this dev driver. */ import type { PGlite } from '@electric-sql/pglite'; import type { PgExecutor } from './pg-executor.js'; /** Minimal structural type for a pglite instance (avoids a hard type dep). */ interface PgliteLike { query(query: string, params?: unknown[]): Promise<{ rows: Row[]; affectedRows?: number; }>; exec(query: string): Promise; close(): Promise; } export declare function pgliteExecutor(db: PGlite | PgliteLike): PgExecutor; export {};