# prisma-next db schema (/docs/cli/next/db-schema)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Inspect a live database schema.

Location: CLI > Next > prisma-next db schema

`prisma-next db schema` reads the live database schema and prints it. The command is read-only.

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

## Usage [#usage]

```bash
prisma-next db schema --db "$DATABASE_URL"
```

## Options [#options]

| Option            | What it does                                   |
| ----------------- | ---------------------------------------------- |
| `--db <url>`      | Connects to the database.                      |
| `--config <path>` | Reads a specific `prisma-next.config.ts` file. |
| `--json`          | Prints machine-readable schema output.         |

## Examples [#examples]

```bash
prisma-next db schema --db "$DATABASE_URL"
prisma-next db schema --db "$DATABASE_URL" --json > schema.json
```

## Related commands [#related-commands]

Use [`prisma-next contract infer`](https://www.prisma.io/docs/cli/next/contract-infer) when you want to turn a live schema into a starter PSL contract. Use [`prisma-next db verify`](https://www.prisma.io/docs/cli/next/db-verify) when you want to compare the live schema with the emitted contract.

## Related pages

- [`CLI configuration`](https://www.prisma.io/docs/cli/next/configuration): Configure Prisma Next CLI commands with prisma-next.config.ts and global flags.
- [`prisma-next contract emit`](https://www.prisma.io/docs/cli/next/contract-emit): Emit Prisma Next contract artifacts.
- [`prisma-next contract infer`](https://www.prisma.io/docs/cli/next/contract-infer): Infer a starter contract from an existing database.
- [`prisma-next db init`](https://www.prisma.io/docs/cli/next/db-init): Initialize a database from the current Prisma Next contract.
- [`prisma-next db sign`](https://www.prisma.io/docs/cli/next/db-sign): Sign a database with the current Prisma Next contract.