API reference
postgres
Import
Section titled “Import”import * as api from "@fungi.computer/watchdog/postgres";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | PostgresWatchdog | PostgreSQL runtime with admission joined to the caller’s checked-out client. |
| type alias | PostgresPurgeStatement | Parameterized queue purge joined to a producer’s existing PostgreSQL transaction. |
| constant | watchdogPostgresSchema | Package-owned schema statements, to run through the deployment migration owner. |
| function | createPostgresWatchdog() | Open the shared Effect engine on a migrated PostgreSQL database. |
| function | purgePostgresQueues() | Purge every attempt in the queues yielded by trusted producer SQL. |
PostgresWatchdogtype alias
Section titled “PostgresWatchdog”type PostgresWatchdog = AsyncWatchdogRuntime & Readonly<{ enqueue: (client, job) => Promise<void>; }>;PostgreSQL runtime with admission joined to the caller’s checked-out client.
PostgresPurgeStatementtype alias
Section titled “PostgresPurgeStatement”type PostgresPurgeStatement = Readonly<{ text: string; values: readonly (string | number | null)[];}>;Parameterized queue purge joined to a producer’s existing PostgreSQL transaction.
watchdogPostgresSchemaconstant
Section titled “watchdogPostgresSchema”const watchdogPostgresSchema: readonly string[];Package-owned schema statements, to run through the deployment migration owner.
createPostgresWatchdog()function
Section titled “createPostgresWatchdog()”function createPostgresWatchdog(options): PostgresWatchdog;Open the shared Effect engine on a migrated PostgreSQL database.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
Readonly<{ execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>; }>; now?: () => number; }> & Readonly<{ database: Pick<Pool, "query">; }> |
Returns
Section titled “Returns”purgePostgresQueues()function
Section titled “purgePostgresQueues()”function purgePostgresQueues(source): readonly Readonly<{ text: string; values: readonly (string | number | null)[];}>[];Purge every attempt in the queues yielded by trusted producer SQL.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
PostgresPurgeStatement |
Returns
Section titled “Returns”readonly Readonly<{ text: string; values: readonly (string |
number | null)[]; }>[]
References
Section titled “References”AsyncWatchdogOptions
Section titled “AsyncWatchdogOptions”Re-exports AsyncWatchdogOptions
AsyncWatchdogRuntime
Section titled “AsyncWatchdogRuntime”Re-exports AsyncWatchdogRuntime