Skip to content

d1

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

Trusted parameter-bound SELECT yielding queued job fields; never lifecycle fields.


D1Admission = Readonly<{ enqueue: (job) => D1PreparedStatement; enqueueFromSelect: (source) => D1PreparedStatement; }>

D1 runtime with admission statements that join the producer’s native batch.


D1Watchdog = AsyncWatchdogRuntime & D1Admission

D1 lifecycle and native transaction admission.


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

Parameterized native purge; caller commits it with its own erasure facts.


AsyncWatchdogOptions = Readonly<{ execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>>; }>; now?: () => number; }>

Host execution and wake scheduling for a shared-database Watchdog.


AsyncWatchdogRuntime = Omit<WatchdogRuntime, "transactional">>

Shared-database runtime; native admission replaces the SQLite projection.

const watchdogD1Schema: readonly string[]

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

createD1Watchdog(options): D1Watchdog

Open the shared Effect engine on a migrated D1 database; no implicit schema writes.

Readonly<{ execute: WatchdogExecutor; wake: Readonly<{ recompute: () => Promise<void>; }>; now?: () => number; }> & Readonly<{ database: D1Database; }>

D1Watchdog


prepareD1Admission(database): D1Admission

Prepare native admission without constructing an executor or performing I/O.

D1Database

D1Admission


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.

D1PurgeStatement

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