createPostgresStorage
function createPostgresStorage(options?): PostgresLinksStorage;Defined in: src/storage/postgres.ts:56
Create a Postgres-backed PostgresLinksStorage. The table is created
lazily on first use; connection (when using connectionString/url) is also
lazy.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
PostgresStorageOptions |
Returns
Section titled “Returns”Example
Section titled “Example”import { createPostgresStorage } from "@xtandard/links/storage/postgres";
// Via connection string (lazy `pg` Pool):const storage = createPostgresStorage({ connectionString: process.env.DATABASE_URL,});
// Or with a pre-built pg Pool / PGlite client:// import { PGlite } from "@electric-sql/pglite";// const storage = createPostgresStorage({ client: new PGlite() });