npx skills add ...
npx skills add prisma/cursor-plugin --skill prisma-cli-db-pull
npx skills add prisma/cursor-plugin --skill prisma-cli-db-pull
prisma db pull. Reference when using this Prisma feature.
Introspects an existing database and updates your Prisma schema to reflect its structure.
schema.prisma with corresponding Prisma models| Option | Description |
|---|---|
--force | Ignore current Prisma schema file |
--print | Print the introspected Prisma schema to stdout |
--schema | Custom path to your Prisma schema |
--config | Custom path to your Prisma config file |
--url | Override the datasource URL from the Prisma config file |
--composite-type-depth | Specify the depth for introspecting composite types (default: -1 for infinite, 0 = off) |
--schemas | Specify the database schemas to introspect |
--local-d1 | Generate a Prisma schema from a local Cloudflare D1 database |
Outputs schema to terminal for review.
Replaces schema file, losing any manual customizations.
Configure database connection in prisma.config.ts:
Initialize Prisma:
Configure database URL
Pull schema:
Review and customize generated schema
Generate client:
When database changes are made outside Prisma:
Database tables become Prisma models:
Becomes:
After db pull, consider:
Rename models to PascalCase:
Rename fields to camelCase:
Add relation names for clarity:
Add documentation:
For MongoDB, db pull samples documents to infer schema:
May require manual refinement since MongoDB is schemaless.
db pull overwrites your schema file. Always:
--print to preview first