Prisma

Installation
SKILL.md

Schema Design Traps

  • @default(cuid()) over @default(uuid()) for IDs—shorter, URL-safe, still unique
  • @updatedAt doesn't update on nested writes—must touch parent record explicitly
  • Implicit many-to-many creates join table you can't customize—use explicit for extra fields
  • @unique on nullable field allows multiple NULLs—intended behavior but often surprising
  • Enum changes require migration—can't add values without downtime unless using String

Query Patterns I Forget

  • findUniqueOrThrow / findFirstOrThrow—cleaner than null check after findUnique
  • createMany skips hooks and returns count only—use create in loop if you need records back
  • upsert requires unique field in where—can't upsert on non-unique compound conditions
  • connectOrCreate in nested writes—avoids separate existence check
  • select and include are mutually exclusive—can't mix; use nested select inside include

N+1 Query Prevention

Installs
1
First Seen
May 5, 2026
Prisma from skills.volces.com