SQLite checkpointer
A durable checkpointer in a single SQLite file. A parked interrupt survives a process restart, a deploy, or a crash.
Install
- TypeScript
- .NET (C#)
@ilmek/checkpoint-sqlite — zero dependencies, on Node's built-in node:sqlite.
npm install @ilmek/core @ilmek/checkpoint-sqlite
Requires Node ≥ 22.5 (for the built-in node:sqlite module).
Ilmek.Checkpointer.Sqlite — backed by Microsoft.Data.Sqlite.
dotnet add package Ilmek.Core
dotnet add package Ilmek.Checkpointer.Sqlite
Targets .NET 9.
Usage
Open the file and hand it to the run — it creates and migrates the database on first use, so there is no separate setup step.
- TypeScript
- .NET (C#)
import { run } from "@ilmek/core";
import { SqliteCheckpointer } from "@ilmek/checkpoint-sqlite";
const cp = await SqliteCheckpointer.open("./agent.db"); // creates + migrates
await run(graph, input, { threadId, checkpointer: cp });
using Ilmek;
var cp = SqliteCheckpointer.Open("./agent.db"); // creates + migrates
var opts = new RunOptions { ThreadId = threadId, Checkpointer = cp };
await IlmekRuntime.RunAsync(graph, input, opts);
Bring your own driver
- TypeScript
- .NET (C#)
It talks to a duck-typed database (exec / prepare), so
better-sqlite3 drops in unchanged
if you would rather use it than the built-in module.
SqliteCheckpointer.Open(path) manages its own connection. To control the
connection yourself — pooling, a shared cache, an in-memory database — construct
it from a SqliteConnection instead:
var cp = new SqliteCheckpointer(connection);
When to reach for Postgres instead
SQLite gives you single-process durability. For threads that must be read and
resumed from more than one process — a web tier plus a worker tier, say — use
@ilmek/checkpoint-postgres instead (TypeScript today;
a .NET Postgres checkpointer is on the roadmap).