Skip to content

@xtandard/kit/storage/postgres

@xtandard/kit/storage/postgres — Postgres storage: one jsonb key/value table over pg or PGlite, created on first use, with single-statement compare-and-swap.

Optional peer: pg (only when the driver creates its own pool from a connection string).

import { … } from "@xtandard/kit/storage/postgres";
Name Summary
createPostgresStorage Create a Postgres-backed PostgresKvStorage. Connection and table creation are lazy.
Name Summary
PostgresKvStorage A compare-and-swap capable storage backed by Postgres, plus close().
PostgresStorageOptions Options for createPostgresStorage.
Name Documented on
ClosableSqlClient @xtandard/kit/storage/postgres/internals
postgresStorageSchema @xtandard/kit/storage/postgres/internals
SqlClient @xtandard/kit/storage/postgres/internals