Skip to content
API reference

post-postgres

Import
import * as api from "@fungi.computer/carrier/post-postgres";
Kind Export Description
type alias PostgresPost Post on PostgreSQL; the producer retains ownership of BEGIN and COMMIT.
type alias PostgresPostErasureStatement Parameterized native erasure; the producer controls BEGIN and COMMIT.
constant postPostgresSchema Carrier-owned PostgreSQL schema, applied by the deployment migration owner.
function createPostgresPost() Bind the Post registry to PostgreSQL; route deadlines are rejected with PostError.
function purgePostgresPost() Purge selected recipient queues, including all envelopes and attempts. The trusted SELECT yields queue_name from producer/envelope facts, not job state.

PostgresPosttype alias

Section titled “PostgresPost”
Signature
type PostgresPost = SqlPostRuntime &
Readonly<{
send: (client, envelope) => Promise<void>;
}>;

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


PostgresPostErasureStatementtype alias

Section titled “PostgresPostErasureStatement”
Signature
type PostgresPostErasureStatement = Readonly<{
text: string;
values: readonly (string | number | null)[];
}>;

Parameterized native erasure; the producer controls BEGIN and COMMIT.

postPostgresSchemaconstant

Section titled “postPostgresSchema”
Signature
const postPostgresSchema: readonly string[];

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

createPostgresPost()function

Section titled “createPostgresPost()”
Signature
function createPostgresPost<R>(options): PostgresPost;

Bind the Post registry to PostgreSQL; route deadlines are rejected with PostError.

Type Parameter
R extends Record<string, Readonly<{ addressKind: string; deadlineMs?: number; 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; }>>
Parameter Type
options 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()function

Section titled “purgePostgresPost()”
Signature
function 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.

Parameter Type
source PostgresPostErasureStatement

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

Re-exports SqlPostOptions


Re-exports SqlPostRuntime