@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Function pgBackend

    • Create a Postgres-backed idempotency cache.

      Pass a connection pool (or any PgQueryable) and optionally a custom table name. Run getIdempotencyMigration() once per deployment to create the table.

      Startup probe. Call store.probe() (or probeIdempotencyStore(store)) before your server starts accepting traffic to catch a bad DATABASE_URL at boot rather than on the first mutating request. Wire it via:

      serve(createAgent, {
      readinessCheck: () => store.probe(),
      });

      Idle-client errors. pg.Pool re-emits network drop / PG restart errors on the pool itself. Without a listener, Node's EventEmitter default-throws and crashes the process. Add one in your bootstrap:

      pool.on('error', (err) => console.error('pg pool error', err));
      

      Parameters

      Returns IdempotencyBackend