SeedCLI — test data that respects your schema
A Go CLI that reads a Postgres or SQLite schema, orders tables by foreign key, and fills them with fake data that passes every constraint.
- Kind
- Tool
- Runs on
- Command line
- Stack
- Go, Cobra, pgx, SQLite, gofakeit
- Status
- Open source
- Written up
SeedCLI turns the empty-database afternoon into one command. It connects to a PostgreSQL or SQLite database, reads the schema as it is right now, works out which tables depend on which, and inserts fake data that satisfies the keys, uniqueness rules and column types it found.
Column names decide the data first (email gets an address, created_at a timestamp), then the column type. Enum columns pick from their real allowed values, and nullable columns are left empty about 30% of the time.
How it holds up
- Introspect, don’t configure. There is no config file to drift from the schema; it reads the schema every run.
- Order by foreign key. Kahn’s algorithm sorts the tables so parents go first, and reports any cycle.
- Repeatable on purpose. The same
--seedagainst the same schema gives the same data, and collisions on unique columns are retried up to 100 times.
The full story is in the build log: seedcli: test data that respects your schema.