# db verify (/docs/cli/db-verify)

> 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.

Verify a database against the current Prisma 8 contract.

Location: CLI > db verify

`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 [#usage]

  

#### bun

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

#### pnpm

```bash
pnpm dlx prisma@latest db verify --db "$DATABASE_URL"
```

#### yarn

```bash
yarn dlx prisma@latest db verify --db "$DATABASE_URL"
```

#### npm

```bash
npx prisma@latest db verify --db "$DATABASE_URL"
```

## Options [#options]

| Option            | What it does                                                                |
| ----------------- | --------------------------------------------------------------------------- |
| `--db <url>`      | Connects to the database.                                                   |
| `--marker-only`   | Checks only the database marker.                                            |
| `--schema-only`   | Checks only whether the live schema satisfies the contract.                 |
| `--strict`        | Fails if the database includes schema elements not present in the contract. |
| `--config <path>` | Read this config file instead of `./prisma.config.ts`.                      |
| `--json`          | Prints machine-readable output.                                             |

## Exit codes [#exit-codes]

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

## Examples [#examples]

  

#### bun

```bash
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
```

#### pnpm

```bash
pnpm dlx prisma@latest db verify --db "$DATABASE_URL"
pnpm dlx prisma@latest db verify --db "$DATABASE_URL" --strict
pnpm dlx prisma@latest db verify --db "$DATABASE_URL" --schema-only
pnpm dlx prisma@latest db verify --db "$DATABASE_URL" --marker-only
```

#### yarn

```bash
yarn dlx prisma@latest db verify --db "$DATABASE_URL"
yarn dlx prisma@latest db verify --db "$DATABASE_URL" --strict
yarn dlx prisma@latest db verify --db "$DATABASE_URL" --schema-only
yarn dlx prisma@latest db verify --db "$DATABASE_URL" --marker-only
```

#### npm

```bash
npx prisma@latest db verify --db "$DATABASE_URL"
npx prisma@latest db verify --db "$DATABASE_URL" --strict
npx prisma@latest db verify --db "$DATABASE_URL" --schema-only
npx prisma@latest db verify --db "$DATABASE_URL" --marker-only
```

Use JSON output in automation:

  

#### bun

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

#### pnpm

```bash
pnpm dlx prisma@latest db verify --db "$DATABASE_URL" --json
```

#### yarn

```bash
yarn dlx prisma@latest db verify --db "$DATABASE_URL" --json
```

#### npm

```bash
npx prisma@latest db verify --db "$DATABASE_URL" --json
```

## What failures mean [#what-failures-mean]

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

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

## Related pages

- [`auth`](https://www.prisma.io/docs/cli/auth): Sign in to your Prisma account from the CLI, sign out, and manage workspace sessions.
- [`branch`](https://www.prisma.io/docs/cli/branch): List platform branches for a project.
- [`bucket`](https://www.prisma.io/docs/cli/bucket): Create and manage object-store buckets.
- [`Configuration`](https://www.prisma.io/docs/cli/configuration): Configure Prisma 8 CLI commands with prisma.config.ts and global flags.
- [`contract emit`](https://www.prisma.io/docs/cli/contract-emit): Emit Prisma 8 contract artifacts.