Prisma 8 is here.Read the docs

db schema

Inspect a live database schema.

db schema reads the live database schema and prints it as a tree, or as the result document with --json. The command is always read-only: it never writes a file and never changes the database.

Use it when you need to inspect what Prisma 8 sees in the database before inferring, signing, updating, or debugging drift.

Usage

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

Options

OptionWhat it does
--db <url>Connects to the database.
--config <path>Read this config file instead of ./prisma.config.ts.
--jsonPrints machine-readable schema output.

Examples

bunx prisma@latest db schema --db "$DATABASE_URL"
bunx prisma@latest db schema --db "$DATABASE_URL" --json > schema.json

Use contract infer when you want to turn a live schema into a starter PSL contract. Use db verify when you want to compare the live schema with the emitted contract.

On this page