@rvkang/batch-postgres
v0.1.0
Published
Postgres persistence adapter for nest-batch.
Maintainers
Readme
@rvkang/batch-postgres
Postgres-backed repository, checkpoint, execution-context, and lock storage
for nest-batch.
Install
pnpm add @rvkang/batch-postgresInitialize storage
import { PostgresBatchStorage } from "@rvkang/batch-postgres";
const storage = new PostgresBatchStorage({
connectionString: process.env.DATABASE_URL,
schema: "batch"
});
await storage.initialize();
// Pass storage to DefaultBatchRunner or NestBatchModule.forRoot({ storage }).
await storage.close();initialize() idempotently creates this adapter's schema objects. The storage
is the durable source of truth for execution state and checkpoints, but a
writer can still be retried after a crash; make external side effects
idempotent.
