prisma
Use when working with Prisma ORM — schema modeling, client queries, migrations, or database management. Also use when setting up Prisma with Neon, Supabase, PlanetScale, or when debugging Prisma-specific query issues.
| Model | Source |
|---|---|
| sonnet | pack: orm |
Full Reference
┏━ 🔧 prisma ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Prisma ORM — schema mode… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Prisma ORM
Section titled “Prisma ORM”Prisma is a TypeScript-first ORM for Node.js. Current stable is Prisma 7 — pure TypeScript, no Rust engine, ~1.6MB bundle. Prisma 6 is still widely deployed and differs in several breaking ways. Schema is defined in a .prisma DSL file; Prisma generates a fully-typed client from it.
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Install (client) | npm install @prisma/client |
| Install (dev) | npm install -D prisma |
| Init project | npx prisma init |
| Generate client | npx prisma generate |
| Dev migration | npx prisma migrate dev --name <name> |
| Deploy migration | npx prisma migrate deploy |
| Reset DB | npx prisma migrate reset |
| Studio UI | npx prisma studio |
| Seed | npx prisma db seed |
| Introspect | npx prisma db pull |
| Config file | prisma/schema.prisma |
| Key env vars | DATABASE_URL, DIRECT_URL (Neon/Supabase) |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Connect to Neon, Supabase, PlanetScale, MySQL, or SQLite | reference/setup.md |
| Define models, field types, enums, indexes, and composite IDs | reference/schema.md |
| Define one-to-one, one-to-many, many-to-many, or self-relations | reference/relations.md |
| Query, filter, paginate, aggregate, and handle errors | reference/queries.md |
| Use transactions — sequential and interactive | reference/transactions.md |
| Generate and apply migrations, seed the database | reference/migrations.md |
| Use $queryRaw or $executeRaw for raw SQL | reference/raw-queries.md |
| Configure Prisma Accelerate, caching, serverless, or edge setup | reference/accelerate-and-serverless.md |
| Migrate from Prisma 6 to 7 or choose between Prisma and Drizzle | reference/version-migration.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.