Skip to content

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.

ModelSource
sonnetpack: orm
Full Reference

┏━ 🔧 prisma ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Prisma ORM — schema mode… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

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.

ItemValue
Install (client)npm install @prisma/client
Install (dev)npm install -D prisma
Init projectnpx prisma init
Generate clientnpx prisma generate
Dev migrationnpx prisma migrate dev --name <name>
Deploy migrationnpx prisma migrate deploy
Reset DBnpx prisma migrate reset
Studio UInpx prisma studio
Seednpx prisma db seed
Introspectnpx prisma db pull
Config fileprisma/schema.prisma
Key env varsDATABASE_URL, DIRECT_URL (Neon/Supabase)
I want to…File
Connect to Neon, Supabase, PlanetScale, MySQL, or SQLitereference/setup.md
Define models, field types, enums, indexes, and composite IDsreference/schema.md
Define one-to-one, one-to-many, many-to-many, or self-relationsreference/relations.md
Query, filter, paginate, aggregate, and handle errorsreference/queries.md
Use transactions — sequential and interactivereference/transactions.md
Generate and apply migrations, seed the databasereference/migrations.md
Use $queryRaw or $executeRaw for raw SQLreference/raw-queries.md
Configure Prisma Accelerate, caching, serverless, or edge setupreference/accelerate-and-serverless.md
Migrate from Prisma 6 to 7 or choose between Prisma and Drizzlereference/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.