@ilmek/checkpoint-postgres
v0.1.1
Published
Postgres checkpointer for ilmek — durable threads over any node-postgres-style client. No hard pg dependency.
Maintainers
Readme
@ilmek/checkpoint-postgres
A durable ilmek checkpointer backed by
Postgres — for threads shared across processes. No hard pg dependency: it talks
to any node-postgres-style client (query(text, params)), so a Client or
Pool drops in as-is.
npm install @ilmek/core @ilmek/checkpoint-postgres pgimport { Pool } from "pg";
import { PostgresCheckpointer } from "@ilmek/checkpoint-postgres";
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const cp = new PostgresCheckpointer(pool);
await cp.migrate();
await run(graph, input, { threadId, checkpointer: cp });Pass tablePrefix so several apps can share one database:
new PostgresCheckpointer(pool, { tablePrefix: "billing" }); // billing_checkpoints, billing_journalsFor single-process durability with no external database, use
@ilmek/checkpoint-sqlite.
