Property-based testing for PostgreSQL. Generates random valid datasets that respect your schema — then tries to break your queries.
⚠ Not yet published — follow the repo for updates
Hand-crafted test data misses edge cases. SqlProof generates thousands of valid random datasets and finds the one that breaks your invariants.
Respects foreign keys, CHECK constraints, UNIQUE, NOT NULL, and enum types automatically. No invalid data, no constraint violations.
When a property fails, fast-check shrinks the dataset to the smallest possible example — so you fix the bug, not hunt for it.
Spins up a disposable Postgres via testcontainers. No external DB needed. Each run gets its own isolated schema — fast and clean.
Drop it into Vitest or Jest. Call proof.check() from an it() block. No new tools to learn.
Reads your SQL file or introspects a live Postgres DB to extract tables, types, FKs, and constraints.
Creates random valid rows for every table in FK-dependency order. Respects all constraints.
Inserts into an isolated Postgres schema, runs your property, then drops the schema. Repeats up to N times.
On failure, shrinks to the minimal counterexample and reports it with a reproducible seed.