Create a AsyncTlsStorage backed by a PostgreSQL database via the pg package.
pg
The adapter creates the tls_snapshots table automatically on the first call to init(). Pass a pg.Pool or pg.Client as the first argument.
tls_snapshots
init()
pg.Pool
pg.Client
An initialised pg.Pool or pg.Client (or any compatible object exposing a query(text, values?) method).
query(text, values?)
An AsyncTlsStorage instance. Call init() before any other method.
AsyncTlsStorage
import { Pool } from 'pg';const pool = new Pool({ connectionString: process.env.DATABASE_URL });const adapter = createPostgresAdapter(pool);await adapter.init(); Copy
import { Pool } from 'pg';const pool = new Pool({ connectionString: process.env.DATABASE_URL });const adapter = createPostgresAdapter(pool);await adapter.init();
Create a AsyncTlsStorage backed by a PostgreSQL database via the
pgpackage.The adapter creates the
tls_snapshotstable automatically on the first call toinit(). Pass apg.Poolorpg.Clientas the first argument.