veriseed
v0.0.2
Published
Generate foreign-key-correct seed data from your Prisma schema. Local-first, zero-dependency core. (The AI-realistic Pro layer — coherent values via a local model, masking, subsetting — is in the works.)
Maintainers
Readme
veriseed
Empty database → believable, working data. One command. Veriseed reads your Prisma schema and writes foreign-key-correct rows — deterministically: --seed 42 (the default) regenerates identical data on every run, from your current schema, so CI seeds never rot; --rows scales it for perf testing. Runs locally: no API key, no account, works offline once installed. Zero dependencies.
npx veriseed demo # built-in sample schema → SQL (try this first)
npx veriseed seed --schema ./prisma/schema.prisma --rows 20 --out seed.sqlWhat you get (npx veriseed demo):
BEGIN;
INSERT INTO "User" ("id","email","name","city","country") VALUES (2,'[email protected]','Aoi Suzuki','Fukuoka','Japan');
INSERT INTO "Post" ("id","title","authorId") VALUES (3,'Local field engine',2); -- authorId → a User that exists
INSERT INTO "Comment" ("id","body","postId") VALUES (1,'Nice graph.',3); -- postId → a Post that exists
COMMIT;
-- name+city+country agree within the row; every foreign key points at a real parent. Reproducible via --seed.Honest status (building in public). This is the free, open-source core. It produces FK-correct rows with light locale coherence (a name, city, and country that match within a row). The Pro layer — genuinely AI-realistic, coherent values via a local model, plus masking and subsetting — is in the works. No cloud, ever. Waitlist / founding pre-order: https://veriseed.netlify.app.
Why
Seed data is a treadmill: your app needs data that matches your schema, and your schema keeps changing. Every current fix fails somewhere:
- Hand-written seeds / fixtures encode yesterday's schema — they break on every migration and make CI flaky, because "roughly the same data" isn't the same data.
- Asking an AI chat is genuinely fine for a one-off small sample (and its values are more lifelike than this Core's — honestly). But it truncates past dozens of rows, invents parent IDs that don't exist, returns different data every ask, and can't run unattended in CI.
- Faker runs locally but has no schema awareness — no FK ordering, no cross-column coherence. You end up hand-writing the toposort, the FK-value-picking, and per-row coherence, with a fresh script for every schema.
supabase-community/seed(the open-sourced Snaplet) is free and OSS, but effectively stagnant.- You can't copy prod into dev/CI for privacy/compliance — so you're generating fake data anyway.
veriseed regenerates the data from the schema, deterministically: parents before children, every FK picked from parent rows that actually exist, byte-identical output for the same --seed — so the seed can live in your repo as a command instead of a fixture file. Any --rows count for scale testing. And it all runs on your machine: nothing about your schema or data is transmitted, to me or to anyone else. The Core does this today; AI-realistic values via a local model, PII masking, and subsetting are the Pro roadmap (see Honest status above).
What the core does
- Parses your Prisma schema (
@id,@relation,@map/@@map, enums, optionals,@default). - Topologically orders tables so foreign keys always resolve.
- Generates rows with light locale coherence (name + city + country agree within a row).
- Picks FK values from already-generated parent PKs → no orphans.
- Emits a single transactional SQL file (
BEGIN; … COMMIT;). Columns with a@default(e.g.createdAt) are left for the DB to fill.
Usage
npx veriseed demo --rows 5 # see it work on a User/Post/Comment sample
npx veriseed seed --schema schema.prisma # seed from your schema (default 10 rows/table)
# options
# --rows <n> rows per table (default 10)
# --seed <n> PRNG seed for reproducible output (default 42)
# --out <file> write to a file instead of stdoutRoadmap (founding members help decide the order)
- Drizzle schema + live Postgres introspection (
--db <url>) - Pro: local-LLM coherent values (real addresses, valid-looking IDs, semantically consistent rows), PII masking, prod-clone subsetting
- More databases / ORMs
License
MIT.
