Updates Claude on Prisma 5.19+ to 7.3 changes: v7 ESM rewrite, prisma-client generator, driver adapters, prisma.config.ts, TypedSQL, SQL comments. Load before Prisma projects.
How this skill is triggered — by the user, by Claude, or both
Slash command
/prisma-knowledge-patch:prisma-knowledge-patchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Claude's baseline knowledge covers Prisma through 5.18. This skill provides changes from 5.19.0 onwards, with major focus on the Prisma 7 rewrite.
Claude's baseline knowledge covers Prisma through 5.18. This skill provides changes from 5.19.0 onwards, with major focus on the Prisma 7 rewrite.
| What Changed | Old (v6) | New (v7+) |
|---|---|---|
| Generator | prisma-client-js | prisma-client (required) |
| Output | Auto in node_modules | output field required |
| Import | from "@prisma/client" | from "./generated/prisma/client" |
| DB connection | Connection string in schema | Driver adapter required |
| Config | schema.prisma datasource | prisma.config.ts at project root |
| Module format | CJS | ESM only ("type": "module") |
| Env vars | Auto-loaded .env | Manual load (use dotenv) |
| Middleware | $use() | Client Extensions $extends() |
| Seeding | Auto after migrate dev | Manual prisma db seed |
| Generate | Auto after migrate dev | Manual prisma generate |
| SSL certs | Ignored invalid certs | Validated by node-pg |
// schema.prisma
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}
// prisma.config.ts (project root)
import "dotenv/config"
import { defineConfig, env } from "prisma/config"
export default defineConfig({
schema: "prisma/schema.prisma",
migrations: { path: "prisma/migrations", seed: "tsx prisma/seed.ts" },
datasource: { url: env("DATABASE_URL") },
})
// app.ts — PostgreSQL
import { PrismaClient } from "./generated/prisma/client"
import { PrismaPg } from "@prisma/adapter-pg"
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
export const prisma = new PrismaClient({ adapter })
// app.ts — SQLite
import { PrismaClient } from "./generated/prisma/client"
import { PrismaBetterSqlite3 } from "@prisma/adapter-better-sqlite3"
const adapter = new PrismaBetterSqlite3({ url: "file:./dev.db" })
export const prisma = new PrismaClient({ adapter })
// app.ts — Prisma Accelerate (no adapter)
import { PrismaClient } from "./generated/prisma/client"
import { withAccelerate } from "@prisma/extension-accelerate"
export const prisma = new PrismaClient({
accelerateUrl: process.env.DATABASE_URL,
}).$extends(withAccelerate())
See references/prisma7-migration.md for full upgrade guide.
Write .sql files in prisma/sql/, generate typed functions:
-- prisma/sql/getUsersByAge.sql
SELECT * FROM "User" WHERE "age" > $1
import { getUsersByAge } from "@prisma/client/sql" // v6
// or from "./generated/prisma/sql" in v7
const users = await prisma.$queryRawTyped(getUsersByAge(18))
import { queryTags, withQueryTags } from '@prisma/sqlcommenter-query-tags'
import { traceContext } from '@prisma/sqlcommenter-trace-context'
const prisma = new PrismaClient({
adapter,
comments: [queryTags(), traceContext()],
})
// Per-request tags
const users = await withQueryTags(
{ route: '/api/users', requestId: 'abc-123' },
() => prisma.user.findMany(),
)
// SQL: SELECT ... FROM "User" /*requestId='abc-123',route='/api/users'*/
Custom plugins implement SqlCommenterPlugin from @prisma/sqlcommenter.
limit on updateMany() and deleteMany()NOT EXISTS replaces NOT IN for PostgreSQL relation filters (better perf)prisma migrate diff options renamed: --from-url → --from-config-datasourcecompilerBuild option ("fast" | "small") in generator block$executeRaw/$queryRaw) bypass query compiler with driver adapters| Requirement | Minimum | Recommended |
|---|---|---|
| Node.js | 20.19.0 | 22.x |
| TypeScript | 5.4.0 | 5.9.x |
npx claudepluginhub nevaberry/nevaberry-plugins --plugin prisma-knowledge-patchPrisma 7 ORM with Rust-free client, 90% smaller bundles, TypedSQL, Omit API, and ESM-first architecture. Use when working with database, schema, migrations, queries, or relations.
Provides fast reference for Prisma 5+ ORM: schema design, migrations, type-safe CRUD, relations, transactions, error handling, testing, and integrations with Supabase, PlanetScale, Neon for TypeScript/JavaScript database access.
Provides expert guidance on Prisma ORM schema design, migrations, query optimization, relations modeling, and database operations for PostgreSQL, MySQL, SQLite.