What problem does it solve?
Prisma ORM boundaries prevent risky, accidental database refactors that scatter query logic, create inconsistent schema changes, and cause runtime failures or connection exhaustion.
Core Features & Use Cases
- Singleton Prisma Client: Centralizes PrismaClient creation to avoid multiple connection pools, especially in serverless and HMR-heavy environments.
- Migration-Only Schema Changes: Ensures schema updates flow through Prisma migrations so generated types and migration history stay consistent.
- Service/Repository/Data Access Separation: Keeps API routes and business logic from calling Prisma directly, making queries testable and enabling consistent select/include shapes to reduce N+1 queries.
Quick Start
Ask your coding agent to enforce a Prisma-first architecture by adding a single PrismaClient in src/lib/db.ts, moving all prisma.user/prisma.post queries into src/repositories, and applying schema changes exclusively via npx prisma migrate dev.