db (Prisma CLI v7) (/docs/cli/v7/db)
For the complete Prisma documentation index, see llms.txt. A markdown version of any docs page is available by appending
.mdto its URL.
Manage your database schema and lifecycle during development
Location: CLI > v7 > db
The prisma db command group provides tools to manage your database schema and lifecycle during development.
prisma db [command] [options]Global options
Section titled “Global options”| Option | Description |
|---|---|
-h, --help |
Display help message |
--config |
Custom path to your Prisma config file |
--schema |
Custom path to your Prisma schema |
Subcommands
Section titled “Subcommands”| Command | Description |
|---|---|
prisma db pull |
Pull the state from the database to the Prisma schema using introspection |
prisma db push |
Push the state from Prisma schema to the database during prototyping |
prisma db seed |
Seed your database |
prisma db execute |
Execute native commands to your database |
Examples
Section titled “Examples”# Pull schema from database
prisma db pull
# Push schema to database
prisma db push
# Seed the database
prisma db seed
# Execute a SQL script
prisma db execute --file ./script.sqlRelated pages
Section titled “Related pages”debug: Display Prisma debug information including schema paths, engine binaries, environment variables, and cache directories for troubleshootingdev: Start a local Prisma Postgres server for developmentformat: Format and validate your Prisma schema file with consistent structuregenerate: Generate artifacts like Prisma Client based on your Prisma schemainit: Set up a new Prisma project in the current directory