SEEDFORGE v2.4.0
v2.4.0 · open source · MIT

seedforge

Point it at your schema. Get a database full of realistic, FK-correct rows.
CLI for CI · library for tests · 7 schema sources · deterministic with --seed 42.

1

Local dev databases

Spin up a fresh Postgres, run your migrations, then fill 8 tables with 10k FK-correct rows in one command. No more hand-written fixtures rotting next to your schema.

2

PR preview environments

Every branch gets a seeded database that looks like production. Reviewers can actually click through the feature instead of staring at empty tables.

3

E2E & load tests

Deterministic --seed 42 output for Playwright, Cypress, or k6. Same dataset every run, no brittle SQL dumps to maintain in git.

4

Demo & sales environments

Populate a staging instance with believable names, emails, and timestamps that won’t embarrass you in a customer call. RFC 2606 safe domains by default.

5

Migration dry-runs

Reseed after a schema migration to catch FK breakage, constraint violations, and enum drift before they ship to prod.

01

Seven schema sources, one command

Introspects live Postgres, MySQL, and SQLite via pg_catalog / information_schema, or parses Prisma, Drizzle, TypeORM, and JPA files on disk. No ORM lock-in, no live DB required.

02

190+ column patterns, zero wiring

Semantic matches on names like email, billing_zip, product_sku, stripe_customer_id, created_at route each column to the right faker generator. No YAML, no decorators, no gibberish.

03

Constraint-aware by construction

Topologically sorts FKs, breaks cycles with deferred updates, threads composite keys, extracts enums from CHECK constraints, tracks UNIQUE, and truncates to VARCHAR(n). The insert order is provably correct — or it exits non-zero.

04

Built for CI and test suites

Drop npx seedforge in a GitHub Action with --seed 42 for byte-identical datasets across runs, or import { seed } from '@otg-dev/seedforge' inside Vitest with transaction rollback. A web-based sampler can’t do either.

~ /bin/seedforge
$ npm install -D @otg-dev/seedforge
added 1 package in 2s

$ npx seedforge --db postgres://localhost/mydb --count 10000 --fast
introspected 8 tables · 12 foreign keys · 2 enums
order: countries → users → categories → products → orders → order_items
 seeded 80,000 rows across 8 tables in 1.4s (COPY mode)
— or programmatically, in your tests
import { seed } from '@otg-dev/seedforge'

await seed('postgres://localhost/mydb', {
  count: 10000,
  seed:  42,    // deterministic output
  fast:  true,  // COPY FROM STDIN
})