1
Configure
Point pg-seed-kit at your seeders and tell it how to connect. pg-seed-kit.config.js
Postgres seeding, one place, any ORM
A lightweight, zero-dependency seeder toolkit for Postgres. Track one-time seed scripts, run them on startup, and manage them from a small CLI. Works with Prisma, Drizzle, TypeORM, and Sequelize.
npm install pg-seed-kit
Point pg-seed-kit at your seeders and tell it how to connect. pg-seed-kit.config.js
Scaffold one with npx pg-seed-kit create add-admin, then use your ORM as usual. Keep it idempotent.
From your app after the ORM connects, or with npx pg-seed-kit run.
success record. The tracking table (seeders) is created automatically.npx pg-seed-kit create <name> # Scaffold a new seeder file
npx pg-seed-kit status # List seeders and statuses
npx pg-seed-kit run # Run all pending seeders
npx pg-seed-kit run <name> # Force-run one seeder by name
npx pg-seed-kit reset <name> # Mark a seeder as pending
| Function | Description |
|---|---|
runPendingSeeders(options?) | Runs seeders without a successful tracking record. |
runSeederByName(name, options?) | Force-runs one seeder, even if already executed. |
getSeederStatuses(options?) | Lists pending, success, and failed seeders. |
resetSeeder(name, options?) | Deletes the tracking record so a seeder can rerun. |
| Option | Type | Default | Description |
|---|---|---|---|
seedersPath | string | () => string | required | Directory of seeder files. |
tableName | string | "seeders" | Tracking table name. |
adapter | Adapter | none | Live adapter for calling the API from your app. |
connect | () => Promise<Adapter> | none | Used by the CLI to open a connection. |