validate

Validate your Prisma schema for syntax errors and configuration issues

The prisma validate command validates the Prisma Schema Language of your Prisma schema file.

Usage

prisma validate [options]

Options

OptionDescription
-h, --helpDisplay help message
--configCustom path to your Prisma config file
--schemaCustom path to your Prisma schema

Examples

Validate the default schema

npx prisma validate

Output on success:

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
The schema at /absolute/path/prisma/schema.prisma is valid

Validate a specific schema

npx prisma validate --schema=./alternative/schema.prisma

Validate with a config file

npx prisma validate --config=./prisma.config.ts

Error output

If the schema has validation errors:

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Schema validation error - Error (query-engine-node-api library)
Error code: P1012
error: The preview feature "unknownFeatureFlag" is not known. Expected one of: [...]
  schema.prisma:3
   |
 2 |     provider        = "prisma-client"
 3 |     previewFeatures = ["unknownFeatureFlag"]
   |

Validation Error Count: 1

On this page