Skip to content
API reference

postgres

Import
import * as api from "@fungi.computer/watchdog/postgres";
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”
Signature
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”
Signature
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”
Signature
const watchdogPostgresSchema: readonly string[];

Package-owned schema statements, to run through the deployment migration owner.

createPostgresWatchdog()function

Section titled “createPostgresWatchdog()”
Signature
function createPostgresWatchdog(options): PostgresWatchdog;

Open the shared Effect engine on a migrated PostgreSQL database.

Parameter Type
options Readonly<{ execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>; }>; now?: () => number; }> & Readonly<{ database: Pick<Pool, "query">; }>

PostgresWatchdog


purgePostgresQueues()function

Section titled “purgePostgresQueues()”
Signature
function purgePostgresQueues(source): readonly Readonly<{
text: string;
values: readonly (string | number | null)[];
}>[];

Purge every attempt in the queues yielded by trusted producer SQL.

Parameter Type
source PostgresPurgeStatement

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

Re-exports AsyncWatchdogOptions


Re-exports AsyncWatchdogRuntime