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:
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));
Create a Postgres-backed idempotency cache.
Pass a connection pool (or any
PgQueryable) and optionally a custom table name. RungetIdempotencyMigration()once per deployment to create the table.Startup probe. Call
store.probe()(orprobeIdempotencyStore(store)) before your server starts accepting traffic to catch a badDATABASE_URLat boot rather than on the first mutating request. Wire it via:Idle-client errors.
pg.Poolre-emits network drop / PG restart errors on the pool itself. Without a listener, Node'sEventEmitterdefault-throws and crashes the process. Add one in your bootstrap: