Skip to main content

@flow-state-dev/vercel/pg

Variables​

vercelPgPoolOptions​

const vercelPgPoolOptions: PoolConfig;

Drop-in pg.PoolConfig defaults tuned for running on Vercel against an auto-suspending Postgres endpoint. Pass through @flow-state-dev/store-postgres' poolOptions input:

import { createPostgresStores } from "@flow-state-dev/store-postgres/host";
import { vercelPgPoolOptions } from "@flow-state-dev/vercel/pg";

const stores = await createPostgresStores({
connectionString: process.env.DATABASE_URL,
poolOptions: process.env.VERCEL ? vercelPgPoolOptions : undefined,
});

Spread to customize: { ...vercelPgPoolOptions, statement_timeout: 30_000 }.