Verify parity
prisma-sql-verify runs the same read queries through plain Prisma and through the speed extension on the same database, then diffs the results — including value types (DateTime, BigInt,Decimal) and nested include shapes. Use it before adopting and after upgrades.
Usage
npx prisma-sql-verify \
--corpus queries.jsonl \
--generated ./generated/sql \
--client @prisma/client \
--sqlite ./data.db
# or PostgreSQL
npx prisma-sql-verify \
--corpus queries.jsonl \
--generated ./generated/sql \
--client ./dist/prisma/generated/client/index.js \
--postgres-url $DATABASE_URLCorpus format
One JSON object per line. Only supported read methods are allowed.
{"model":"user","method":"findMany","args":{"take":5}}
{"model":"user","method":"findFirst","args":{"include":{"posts":true},"orderBy":{"id":"asc"}}}
{"model":"user","method":"count","args":{"where":{"status":"ACTIVE"}}}
{"model":"user","method":"aggregate","args":{"_count":true,"_avg":{"age":true}}}Flags
| Flag | Description |
|---|---|
--corpus | Path to the JSONL corpus file (required) |
--generated | Generated SQL module or directory exporting speedExtension (required). Under tsx, a directory with index.ts works too. |
--client | Module path or package name exporting PrismaClient (required) |
--sqlite | SQLite database file to verify against |
--postgres-url | PostgreSQL connection string (falls back to DATABASE_URL) |
--client-init | JSON string passed to the PrismaClient constructor. When omitted, prisma-sql-verify auto-builds a driver adapter for Prisma 7 clients (@prisma/adapter-better-sqlite3 / @prisma/adapter-pg must be installed). |
--verbose | Print passing queries too |
Exit codes and output
0— every query matches Prisma1— at least one mismatch; each mismatch prints the diff paths, e.g.$.assignedTasks[0].dueDate: prisma=... extended=..., ready to paste into an issue2— usage or setup error
Tip: build your corpus from real application queries. A corpus of realistic shapes is worth more than a large synthetic one.