API reference
post-postgres
Import
Section titled “Import”import * as api from "@fungi.computer/carrier/post-postgres";Exports
Section titled “Exports”| 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”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”type PostgresPostErasureStatement = Readonly<{ text: string; values: readonly (string | number | null)[];}>;Parameterized native erasure; the producer controls BEGIN and COMMIT.
postPostgresSchemaconstant
Section titled “postPostgresSchema”const postPostgresSchema: readonly string[];Carrier-owned PostgreSQL schema, applied by the deployment migration owner.
createPostgresPost()function
Section titled “createPostgresPost()”function createPostgresPost<R>(options): PostgresPost;Bind the Post registry to PostgreSQL; route deadlines are rejected with PostError.
Type Parameters
Section titled “Type Parameters”| 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; }>> |
Parameters
Section titled “Parameters”| 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; }> |
Returns
Section titled “Returns”purgePostgresPost()function
Section titled “purgePostgresPost()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
PostgresPostErasureStatement |
Returns
Section titled “Returns”readonly Readonly<{ text: string; values: readonly (string |
number | null)[]; }>[]
References
Section titled “References”SqlPostOptions
Section titled “SqlPostOptions”Re-exports SqlPostOptions
SqlPostRuntime
Section titled “SqlPostRuntime”Re-exports SqlPostRuntime