Context
The current Prisma adapter (src/server/adapters/prisma.ts) uses prisma.$use() middleware to intercept create/update/delete operations. This API was deprecated in Prisma v4.16.0 and removed in Prisma v7.0.0 (November 2025).
Required Change
Migrate from $use() middleware to Prisma Client Extensions ($extends({ query: { ... } })), which is the officially supported replacement.
The $extends API provides per-model and per-operation hooks via query:
const prisma = new PrismaClient().$extends({
query: {
$allModels: {
async create({ model, args, query }) { ... },
async update({ model, args, query }) { ... },
async delete({ model, args, query }) { ... },
},
},
})
Impact
- The current adapter works with Prisma v4-v6
- Users on Prisma v7+ cannot use
createPrismaAdapter at all
- The adapter interface (
SSEAdapter) stays the same — only the internal registration mechanism changes
Acceptance Criteria
Context
The current Prisma adapter (
src/server/adapters/prisma.ts) usesprisma.$use()middleware to intercept create/update/delete operations. This API was deprecated in Prisma v4.16.0 and removed in Prisma v7.0.0 (November 2025).Required Change
Migrate from
$use()middleware to Prisma Client Extensions ($extends({ query: { ... } })), which is the officially supported replacement.The
$extendsAPI provides per-model and per-operation hooks viaquery:Impact
createPrismaAdapterat allSSEAdapter) stays the same — only the internal registration mechanism changesAcceptance Criteria
$extends()instead of$use()