Prisma ORM 8 is here.Read the docs

db verify

Verify a database against the current Prisma ORM contract.

db verify checks whether the database marker and live schema match your emitted contract. It verifies the marker first, then checks the schema.

Use it in CI and deployment checks before application code that depends on a contract reaches users.

Usage

bunx prisma@latest db verify --db "$DATABASE_URL"

Options

OptionWhat it does
--db <url>Connects to the database.
--marker-onlyChecks only the database marker.
--schema-onlyChecks only whether the live schema satisfies the contract.
--strictFails if the database includes schema elements not present in the contract.
--config <path>Read this config file instead of ./prisma.config.ts.
--jsonPrints machine-readable output.

Exit codes

CodeMeaning
0The database matches the contract.
2The check could not run: conflicting mode flags, no emitted contract, or unreachable database.
4Drift or a marker finding.

Examples

bunx prisma@latest db verify --db "$DATABASE_URL"
bunx prisma@latest db verify --db "$DATABASE_URL" --strict
bunx prisma@latest db verify --db "$DATABASE_URL" --schema-only
bunx prisma@latest db verify --db "$DATABASE_URL" --marker-only

Use JSON output in automation:

bunx prisma@latest db verify --db "$DATABASE_URL" --json

What failures mean

FailureMeaning
Marker mismatchThe database was not signed for the emitted contract, or the contract changed after signing.
Schema mismatchThe live database does not satisfy the emitted contract.
Strict mismatchThe database has extra schema elements not present in the contract.
Extension mismatchThe contract requires an extension that is not wired in the config.

Fix the database or contract, emit again if needed, then verify again.

On this page