What teams use Ghostrow for.
Every one of these starts from the same place: a schema, and a need for data that behaves like the real thing without being the real thing.
A realistic local database
Every plan
A fresh database on a laptop is empty, and a copy of production is something nobody should have on a laptop. Hand-written seed scripts drift from the schema and break the moment a column gets a new constraint.
Point Ghostrow at the schema and it fills every table in dependency order, keeping foreign keys, unique columns and checks. Each developer gets the same data from the same seed, and rerunning after a migration picks up the new columns.
ghostrow seed --db postgres://localhost/app_dev --rows 20000 --seed 1Seed in the docsFinding the inputs your tests never try
Pro and Max
Fixtures are written by the people who wrote the code, so they contain the values the code already expects. Bugs live in the other values: the longest allowed name, 29 February, a time that happens twice when the clocks go back.
Haunt generates those rows inside your schema’s limits and your validators’ rules, runs your test command, and attributes each failing test to the rows that caused it, narrowing a failure down to the column that broke it.
ghostrow haunt --db postgres://localhost/app_test --tests "npm test"Haunt in the docsStable fixtures in CI
Every plan; CI tokens on Max
Tests that depend on random data fail on Tuesdays for reasons nobody can reproduce, and checked-in fixture files go stale as the schema moves.
A fixed seed gives byte-identical output on every runner, so a failure reproduces locally with the same command. On Max, a CI token lets pipelines use the license without counting as machines.
ghostrow seed --schema db/schema.sql --seed 42 --out fixtures/ --format sql --quietCI in the docsA staging database shaped like production
Max
Performance problems and odd query plans only show up with production’s proportions: the customer with forty thousand orders, the column that is ninety percent empty. Copying production to get them moves personal data into places it shouldn’t be.
Twin measures value ranges, null rates and how many children each parent has, on your machine, and generates a new database with the same shape. Categories shared by fewer than five rows are left out, and no row is copied.
ghostrow twin --from $REPLICA_URL --to postgres://staging/app --scale 0.1Twin in the docsDemo and training environments
Plus and up
Sales demos and onboarding sandboxes need data that looks like a real business, with real-looking names, addresses and order histories, and none of it can belong to an actual customer.
Seed produces believable people, companies, products and transactions that add up: order totals match their lines, dates run in order. Rebuild the environment from the same seed whenever a demo leaves it in a mess.
ghostrow seed --db $DEMO_DATABASE_URL --rows 5000 --seed 2027QuickstartSee what it makes of your schema.
npm i -g ghostrow && ghostrow seed --schema schema.sql --dry-run