OpfsWorker unstable
Runs the worker side of the browser SQLite WASM client that stores data in OPFS.
This module opens @effect/wa-sqlite with the OPFS access-handle VFS, then
listens on a MessagePort-compatible port for the protocol used by
SqliteClient. It sends a ready message, executes SQL messages, imports and
exports database bytes, forwards update-hook notifications, and closes when
requested. It is meant to run in a dedicated worker or a SharedWorker.
Models
Configuration for the SQLite OPFS worker, including the message port used for the client protocol and the OPFS database name to open.
Signature
interface OpfsWorkerConfig { readonly dbName: string; readonly port: EventTarget & Pick<MessagePort, "postMessage" | "close"> & Partial<Pick<MessagePort, "start">>;}Running
Runs the SQLite OPFS worker loop, opening the configured database, posting a ready message, handling query/import/export/update-hook messages, and closing when a close message is received.
Signature
declare function run(options: OpfsWorkerConfig): Effect<void, SqlError>