mcpField
P
prisma-7

prisma-7

github.com/fusengineDevelopment3463 installsUpdated 2w ago
Repository

About prisma-7

A reference skill for developers and coding agents building with Prisma 7, covering setup, schema design, queries, migrations, performance, security, and deployment. It highlights the v6-to-v7 breaking changes and includes TypeScript interface references.

Key features

  1. 01Prisma 6-to-7 migration guidance
  2. 02Schema modeling and typed queries
  3. 03CRUD, relations, and transactions
  4. 04Migration and performance references
  5. 05Security and deployment guidance
  6. 06SOLID TypeScript interface references

Use cases

  1. 01Upgrading a project from Prisma 6
  2. 02Designing schemas and database queries
  3. 03Planning safe database migrations
  4. 04Troubleshooting deployment and performance

MCP support

The reference guide includes an MCP Server topic, but does not describe MCP functionality provided by this skill.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fusengine/agents --skill prisma-7

After installing, type/prisma-7in Claude Code to confirm it loaded.

Details

From the project README
Covers Prisma 7's Rust-free TypeScript ORM: the v6→v7 breaking changes (provider renamed `prisma-client-js` → `prisma-client`, output path now REQUIRED, import moves from `@prisma/client` to the generated path, database driver adapters now required — e.g. `@prisma/adapter-pg` for PostgreSQL — and config moved to a TS config file — `prisma7.config.ts` from 7.10 (`prisma.config.*` still read as fallback), `prisma.config.ts` on 7.0–7.9), schema modeling, CRUD/relations/filtering/pagination/transactions, TypedSQL for type-safe raw queries, and the Omit API for excluding sensitive fields.

Also spans migrations (baselining, shadow database, squashing, zero-downtime), performance (N+1 detection, connection pooling, Accelerate), security (SQL injection prevention, row-level security, encryption), per-database guides (PostgreSQL, MySQL, SQLite, CockroachDB, Turso — MongoDB unsupported in all Prisma 7.x releases through 7.10; stay on 6.19), framework integrations (Next.js, Astro, SvelteKit, Remix, and more), and deployment across Vercel/Netlify/Railway/AWS Lambda/Cloudflare Workers/Docker. Includes SOLID-compliant TypeScript interface references for schema design. Does not cover Better Auth's own database adapter configuration in depth (better-auth) — this skill is the ORM layer itself.

Prisma 7 ORM

Rust-free TypeScript ORM with 90% smaller bundles and 3x faster queries.

Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Analyze existing schema and database patterns
  2. fuse-ai-pilot:research-expert - Verify latest Prisma 7 docs via Context7/Exa
  3. mcp__context7__query-docs - Check breaking changes and migration guide

After implementation, run fuse-ai-pilot:sniper for validation.


Overview

When to Use
  • Database access in Next.js 16 applications
  • Type-safe queries with full TypeScript inference
  • Schema-first database modeling and migrations
  • Complex queries requiring TypedSQL
  • Excluding sensitive fields with Omit API
Why Prisma 7
FeatureBenefit
Rust-free client90% smaller bundles (14MB → 1.6MB)
Query performanceUp to 3x faster on large datasets
ESM-firstNative ES modules, modern architecture
TypedSQLType-safe raw SQL queries
Omit APIExclude sensitive fields globally
Driver adaptersDirect database driver integration

Breaking Changes from v6

Critical Migration Points
Changev6v7
Providerprisma-client-jsprisma-client
Output pathOptionalREQUIRED
Import@prisma/client./generated/prisma/client
DriversBuilt-inAdapter required
ConfigSchema onlyprisma7.config.ts (7.10+, falls back to prisma.config.*); prisma.config.ts (7.0–7.9) — edit the file prisma init created
Required Schema Changes

Provider must be prisma-client with explicit output path. No more generation to node_modules.

Driver Adapters Required

PostgreSQL requires @prisma/adapter-pg, MySQL requires @prisma/adapter-mariadb, SQLite requires @prisma/adapter-better-sqlite3.

Notable 7.x Minor Releases (current stable: 7.10.0)
VersionChange
7.4Query plan caching in Prisma Client; partialIndexes preview feature (@@index(..., where: raw("...")))
7.5Nested transaction rollbacks via savepoints
7.6prisma postgres link; @prisma/adapter-pg accepts a connection string directly
7.7prisma bootstrap command
7.8queryPlanCacheMaxSize option on PrismaClient (0 disables the cache)
7.9CLI tab completions; AI-agent safety checks extended to db push --accept-data-loss; TypeScript perf regression from 7.0 fixed
7.10Prisma Studio bound to 127.0.0.1 with origin checks; @prisma/adapter-mariadb accepts an existing pool

Prisma 8 is in release candidate only (npm latest tag points to 8.0.0-rc.*) — pin prisma@7 / @prisma/client@7 for stable installs.


SOLID Architecture

Module Structure

Database code organized in modules/cores/db/:

  • modules/cores/db/prisma.ts - Singleton PrismaClient
  • modules/cores/db/generated/ - Generated client
  • prisma/schema.prisma - Schema definition
  • prisma/migrations/ - Migration history
  • prisma7.config.ts - Prisma configuration (7.0–7.9: prisma.config.ts)
File Organization
FilePurpose
prisma.tsSingleton client
schema.prismaModels, relations
seed.tsDatabase seeding

Key Concepts

Singleton Pattern (Next.js)

Prevent multiple PrismaClient instances during hot-reload. Use globalThis to cache instance in development.

Output Path

Generated client goes to custom path, not node_modules. Import from generated folder.

Driver Adapters

Direct database driver integration for better performance and control. Configure connection pooling at driver level.

TypedSQL

Write raw SQL with full type safety. Results are typed based on query.

Omit API

Exclude fields globally or per-query. Perfect for passwords and sensitive data.


Reference Guide (130 files)

Core Setup
NeedReference
Initial setupinstallation.md
PrismaClient singletonclient.md
Client API methodsclient-api.md
Configurationprisma-config.md
CLI commandscli-reference.md
Editor setupeditor-setup.md
Schema & Modeling
NeedReference
Schema designschema.md
Schema syntaxschema-reference.md
Data modelingdata-modeling.md
Field attributesfield-attributes.md
Model attributesmodel-attributes.md
Enumsenums.md
Default valuesdefault-values.md
Composite typescomposite-types.md
Scalar lists/arraysscalar-lists.md
Referential actionsreferential-actions.md
Queries & Operations
NeedReference
CRUD operationsqueries.md
Relationsrelations.md
Filteringfiltering.md
Sortingsorting.md
Select vs Includeselect-include.md
Pagination (cursor)pagination-cursor.md
Pagination (offset)pagination-offset.md
Distinctdistinct.md
Count & existscount-exists.md
Case sensitivitycase-sensitivity.md
Aggregationsaggregations.md
Transactionstransactions.md
Advanced Queries
NeedReference
TypedSQLtypedsql.md
Raw queriesraw-queries.md
JSON fieldsjson-fields.md
Full-text searchfull-text-search.md
Viewsviews.md
Stored proceduresstored-procedures.md
Triggerstriggers.md
Constraintsconstraints.md
Advanced indexesindexes-advanced.md
Migrations
NeedReference
Migration workflowmigrations.md
Seedingseeding.md
Baseliningbaselining.md
Shadow databaseshadow-database.md
Migration historymigration-history.md
Squashingsquashing.md
Hotfixinghotfixing.md
Down migrationsdown-migrations.md
Data migrationsdata-migrations.md
Zero-downtimezero-downtime.md
Performance
NeedReference
Optimizationoptimization.md
Query optimizationquery-optimization.md
N+1 problemn-plus-one.md
Batchingbatching.md
Lazy loadinglazy-loading.md
Caching strategiescaching-strategies.md
Connection limitsconnection-limits.md
Cold startscold-starts.md
Bundle sizebundle-size.md
Accelerateaccelerate.md
Connection poolingconnection-pooling.md
Security
NeedReference
Connection URLsconnection-urls.md
Environment variablesenvironment-variables.md
SSL/TLSssl-tls.md
SQL injectionsql-injection.md
Row-level securityrow-level-security.md
Encryptionencryption.md
Audit loggingaudit-logging.md
GDPR compliancegdpr-compliance.md
Databases
NeedReference
PostgreSQLpostgresql.md
MySQLmysql.md
SQLitesqlite.md
MongoDB (deprecated)mongodb.md
CockroachDBcockroachdb.md
PlanetScaleplanetscale.md
Supabasesupabase.md
Neonneon.md
Tursoturso.md
Extensions & Integrations
NeedReference
Extensionsextensions.md
Driver adaptersdriver-adapters.md
Omit APIomit-api.md
Middleware (deprecated)middleware.md
Soft deletesoft-delete.md
Read replicasread-replicas.md
Multi-databasemulti-database.md
Multi-schemamulti-schema.md
Framework Integrations
NeedReference
Next.jsnextjs-integration.md
Astroastro.md
Nuxtnuxt.md
SvelteKitsveltekit.md
SolidStartsolidstart.md
Remixremix.md
React Routerreact-router.md
Honohono.md
Expressexpress.md
Auth Integrations
NeedReference
Clerkclerk.md
Auth.jsauthjs.md
Better Authbetterauth.md
Permit.iopermit-io.md
Deployment
NeedReference
Deployment guidedeployment.md
Vercelvercel.md
Netlifynetlify.md
Railwayrailway.md
Renderrender.md
Fly.ioflyio.md
AWS Lambdaaws-lambda.md
Cloudflare Workerscloudflare-workers.md
Dockerdocker.md
Herokuheroku.md
Deno Deploydeno-deploy.md
Tooling
NeedReference
VS Codevscode.md
GitHub Copilotgithub-copilot.md
Tabninetabnine.md
SafeQLsafeql.md
Prisma AIprisma-ai.md
MCP Servermcp-server.md
Turborepoturborepo.md
pnpm workspacespnpm-workspaces.md
Monitoring
NeedReference
Error handlingerror-handling.md
Error codeserror-codes.md
Logginglogging.md
OpenTelemetryopentelemetry.md
DataDogdatadog.md
Studiostudio.md
Testingtesting.md
ORM Comparisons
NeedReference
vs TypeORMvs-typeorm.md
vs Sequelizevs-sequelize.md
vs Drizzlevs-drizzle.md
vs Mongoosevs-mongoose.md
vs Kyselyvs-kysely.md
Migration Guides
NeedReference
From TypeORMmigrate-from-typeorm.md
From Sequelizemigrate-from-sequelize.md
From Drizzlemigrate-from-drizzle.md
TypeScript Interfaces (SOLID)

references/interfaces/ holds SOLID-compliant type definitions for Prisma 7 schema design, separated from implementation. Load when writing or reviewing typed schema code:

NeedReference
Overview of all interface filesinterfaces/INDEX.md
Schema types: GeneratorConfig, ModelDefinition, FieldAttribute, EnumDefinitioninterfaces/schema.types.md
Data modeling types: normalization, cardinalityinterfaces/data-modeling.types.md
Enum types: value definitions, status/role patternsinterfaces/enums.types.md
Field attribute types: identity, unique, default, mappinginterfaces/field-attributes.types.md
Model attribute types: composite keys, composite indexesinterfaces/model-attributes.types.md
Relation types: one-to-one, referential actions, cascadeinterfaces/relations.types.md
Migration types: workflow, deploy, seedinginterfaces/migrations.types.md

Best Practices

  1. Singleton in Next.js - Cache PrismaClient in globalThis
  2. Output path required - Never generate to node_modules
  3. Driver adapters - Use native drivers for better performance
  4. Omit sensitive fields - Configure global omit for passwords
  5. TypedSQL for complex - Use for queries Prisma can't express
  6. Index verification - Check query plans for N+1 issues

Forbidden Patterns

PatternReasonAlternative
Import from @prisma/clientv7 requires generated pathImport from ./generated/prisma/client
prisma-client-js providerDeprecated in v7Use prisma-client
No output pathRequired in v7Set output in generator
MongoDBNot supported in v7.x (7.0-7.10)Stay on Prisma 6.19
url in datasourceDeprecatedUse the config file (prisma7.config.ts on 7.10+, prisma.config.ts on 7.0–7.9)

Comments

Markdown supported