affaan-m avatar

Prisma Patterns

This is the Prisma cheat sheet you wish you'd had before running `updateMany` and wondering why it returned a count instead of records, or before `migrate dev` reset your local database mid-sprint. It covers the traps that actually bite: `@updatedAt` skipped on bulk writes, `$transaction` timeouts in long operations, serverless connection pool exhaustion, and the N+1 problem with eager loading. You also get practical patterns for cursor pagination, soft delete filtering, singleton client setup, and when to use the interactive versus array transaction form. Activate it when writing queries, designing schemas, or deploying to serverless, especially if you're past the tutorial phase and dealing with production edge cases.

skills.sh installs
5.5K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill prisma-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Prisma Patterns

Production patterns and non-obvious traps for Prisma ORM in TypeScript backends.

Check your version before applying patterns. The Prisma API surface has evolved across major releases:

npx prisma --version

Notable API differences across versions:

  • relationJoins can load relations via JOIN rather than separate queries, but may cause row explosion on large 1:N relations or deep include — benchmark both approaches
  • omit field modifier and prisma.$extends Client Extensions API were added
  • Newer installs: the package may be named prisma instead of @prisma/client; PrismaClient may require a driver adapter (e.g. @prisma/adapter-pg); datasource.url may live in prisma.config.ts instead of schema.prisma
  • CLI commands (migrate dev, migrate deploy, generate) are unchanged across versions

When to Activate

Sponsors

Details

Repository
github.com/affaan-m/ecc
Categories
Backend & APIs, Cloud & Infrastructure, Design & UI/UX, Databases
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1lobehub avatardrizzlelobehub/lobehubLobeHub Drizzle ORM schema and query style. Use for pgTable schemas, indexes, joins, inferred types, db.select/db.query, schema fields, foreign keys, junction t5.5Kskills.sh installs
2apollographql avatargraphql-schemaapollographql/skillsGuide for designing GraphQL schemas following industry best practices. Use this skill when: (1) designing a new GraphQL schema or API, (2) reviewing existing sc4.3Kskills.sh installs
3dpearson2699 avatarauthenticationdpearson2699/swift-ios-skillsImplement iOS authentication flows with AuthenticationServices and LocalAuthentication. Use when building Sign in with Apple, passkey/WebAuthn registration or s4.1Kskills.sh installs
4yaklang avatarauth-secyaklang/hack-skillsEntry P1 category router for authentication and authorization. Use when testing login flows, sessions, object authorization, JWT, OAuth, CORS, CSRF, and enterpr3.9Kskills.sh installs
5dotnet avatarconfigure-authdotnet/skillsAdd authentication and authorization to a Blazor Web App, accounting for the app's render mode. USE WHEN the user needs [Authorize] on pages, AuthorizeView, rol3.9Kskills.sh installs
6inngest avatarinngest-middlewareinngest/inngest-skillsUse when adding cross-cutting concerns to durable functions — structured logging or tracing across all functions, error tracking with Sentry, payload encryption3.8Kskills.sh installs