Skip to content

post-postgres

PostgresPost = SqlPostRuntime & Readonly<{ send: (client, envelope) => Promise<void>>; }>

Post on PostgreSQL; the producer retains ownership of BEGIN and COMMIT.


PostgresPostErasureStatement = Readonly<{ text: string; values: readonly (string | number | null)[]; }>

Parameterized native erasure; the producer controls BEGIN and COMMIT.

const postPostgresSchema: readonly string[]

Carrier-owned PostgreSQL schema, applied by the deployment migration owner.

createPostgresPost<R>>(options): PostgresPost

Bind the Post registry to a PostgreSQL owner and the shared delivery engine.

R extends Record<string, Readonly<{ addressKind: string; address: Codec<unknown, unknown>; event: Codec<unknown, unknown>; encodeEnvelope: (envelope) => object; parseDelivery: (envelope) => object; prepareEnvelope?: (envelope, signal) => Promise<{ key: string; kind: string; address: unknown; event: unknown; }>; recordDelivered?: (envelope) => void; nameOf: (envelope) => string; namespace: Readonly<{ getByName: (name) => Readonly<{ deliver: (envelope) => Promise<PostDeliveryResult>; }>; }>; recordCursor?: (envelope, cursor) => void; recordRefused?: (envelope) => void; }>>

Readonly<{ routes: R; failureDetail?: (cause) => string; retry?: Readonly<{ maxAttempts: number; baseDelayMs: number; maxDelayMs: number; }>; now: () => number; scheduleWake: (at) => Promise<void>; }> & Readonly<{ database: Pick<Pool, "query" | "connect">; watchdog: PostgresWatchdog; }>

PostgresPost


purgePostgresPost(source): readonly Readonly<{ text: string; values: readonly (string | number | null)[]; }>[]

Purge selected recipient queues, including all envelopes and attempts. The trusted SELECT yields queue_name from producer/envelope facts, not job state.

PostgresPostErasureStatement

readonly Readonly<{ text: string; values: readonly (string | number | null)[]; }>[]

Re-exports SqlPostOptions


Re-exports SqlPostRuntime