@ai-digital-factory/state-flow-storage-sqlite
v0.2.0
Published
SQLite storage adapter for the State Flow durable runtime: data survives restarts (ADR 0109). Requires Node.js 22.13+ for node:sqlite.
Readme
@ai-digital-factory/state-flow-storage-sqlite
SQLite storage for the State Flow durable runtime (ADR 0109): instances, recovery and history survive restarts and deploys. Requires Node.js 22.13 or later for node:sqlite.
import { createRuntime } from "@ai-digital-factory/state-flow-runtime";
import { sqliteStorage } from "@ai-digital-factory/state-flow-storage-sqlite";
await using runtime = await createRuntime({
storage: sqliteStorage({ path: "state-flow.db" }),
});State Flow owns the file's schema. The application owns where the file lives, its backups and its lifetime, and never writes to it directly (ADR 0047). One runtime owns the file at a time: a second one is refused with OwnershipError, and a crashed process releases it. A file written by anything else, including runtimes before this adapter, is refused with SchemaError; start with an empty file.
