tls-devicer
    Preparing search index...

    Function createPostgresAdapter

    • Create a AsyncTlsStorage backed by a PostgreSQL database via the pg package.

      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.

      Parameters

      • pool: PgPoolLike

        An initialised pg.Pool or pg.Client (or any compatible object exposing a query(text, values?) method).

      Returns AsyncTlsStorage

      An AsyncTlsStorage instance. Call init() before any other method.

      import { Pool } from 'pg';
      const pool = new Pool({ connectionString: process.env.DATABASE_URL });
      const adapter = createPostgresAdapter(pool);
      await adapter.init();