Postgres seeding, one place, any ORM

Seed your Postgres database with the ORM you already use.

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
Zero runtime dependencies ESM + CommonJS TypeScript-first

Choose your ORM

1

Configure

Point pg-seed-kit at your seeders and tell it how to connect. pg-seed-kit.config.js

2

Write a seeder

Scaffold one with npx pg-seed-kit create add-admin, then use your ORM as usual. Keep it idempotent.

3

Run

From your app after the ORM connects, or with npx pg-seed-kit run.

How it works

  1. Seeder files are sorted by their timestamp prefix, so they run in order.
  2. Each run executes only seeders without a success record. The tracking table (seeders) is created automatically.
  3. A failed seeder is recorded and retried next run; the others keep going.

CLI

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

API & options

FunctionDescription
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.
OptionTypeDefaultDescription
seedersPathstring | () => stringrequiredDirectory of seeder files.
tableNamestring"seeders"Tracking table name.
adapterAdapternoneLive adapter for calling the API from your app.
connect() => Promise<Adapter>noneUsed by the CLI to open a connection.