d1
Import
Section titled “Import”import * as api from "@fungi.computer/watchdog/d1";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | D1AdmissionSource | Trusted parameter-bound SELECT yielding queued job fields; never lifecycle fields. |
| type alias | D1Admission | D1 runtime with admission statements that join the producer’s native batch. |
| type alias | D1Watchdog | D1 lifecycle and native transaction admission. |
| type alias | D1PurgeStatement | Parameterized native purge; caller commits it with its own erasure facts. |
| type alias | AsyncWatchdogOptions | Host execution and wake scheduling for a shared-database Watchdog. |
| type alias | AsyncWatchdogRuntime | Shared-database runtime; native admission replaces the SQLite projection. |
| constant | watchdogD1Schema | Package-owned schema statements, to run through the deployment migration owner. |
| function | createD1Watchdog() | Open the shared Effect engine on a migrated D1 database; no implicit schema writes. |
| function | prepareD1Admission() | Prepare native admission without constructing an executor or performing I/O. |
| function | purgeD1Queues() | Purge every attempt in selected queues, fencing any executor still holding a claim. The trusted SELECT yields queue_name. It never supplies lifecycle mutations. |
D1AdmissionSourcetype alias
Section titled “D1AdmissionSource”type D1AdmissionSource = Readonly<{ text: string; values: readonly (string | number | null)[];}>;Trusted parameter-bound SELECT yielding queued job fields; never lifecycle fields.
D1Admissiontype alias
Section titled “D1Admission”type D1Admission = Readonly<{ enqueue: (job) => D1PreparedStatement; enqueueFromSelect: (source) => D1PreparedStatement;}>;D1 runtime with admission statements that join the producer’s native batch.
D1Watchdogtype alias
Section titled “D1Watchdog”type D1Watchdog = AsyncWatchdogRuntime & D1Admission;D1 lifecycle and native transaction admission.
D1PurgeStatementtype alias
Section titled “D1PurgeStatement”type D1PurgeStatement = Readonly<{ text: string; values: readonly (string | number | null)[];}>;Parameterized native purge; caller commits it with its own erasure facts.
AsyncWatchdogOptionstype alias
Section titled “AsyncWatchdogOptions”type AsyncWatchdogOptions = Readonly<{ execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>; }>; now?: () => number;}>;Host execution and wake scheduling for a shared-database Watchdog.
AsyncWatchdogRuntimetype alias
Section titled “AsyncWatchdogRuntime”type AsyncWatchdogRuntime = Omit<WatchdogRuntime, "transactional">;Shared-database runtime; native admission replaces the SQLite projection.
watchdogD1Schemaconstant
Section titled “watchdogD1Schema”const watchdogD1Schema: readonly string[];Package-owned schema statements, to run through the deployment migration owner.
createD1Watchdog()function
Section titled “createD1Watchdog()”function createD1Watchdog(options): D1Watchdog;Open the shared Effect engine on a migrated D1 database; no implicit schema writes.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
Readonly<{ execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>; }>; now?: () => number; }> & Readonly<{ database: D1Database; }> |
Returns
Section titled “Returns”prepareD1Admission()function
Section titled “prepareD1Admission()”function prepareD1Admission(database): D1Admission;Prepare native admission without constructing an executor or performing I/O.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
database |
D1Database |
Returns
Section titled “Returns”purgeD1Queues()function
Section titled “purgeD1Queues()”function purgeD1Queues(source): readonly Readonly<{ text: string; values: readonly (string | number | null)[];}>[];Purge every attempt in selected queues, fencing any executor still holding a claim. The trusted SELECT yields queue_name. It never supplies lifecycle mutations.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
D1PurgeStatement |
Returns
Section titled “Returns”readonly Readonly<{ text: string; values: readonly (string |
number | null)[]; }>[]