Overview
Prisma 7 (released 2025-11-19) removes the Rust query engine, so the client needs a driver adapter, the generator and import paths change, and the connection URL moves into prisma.config.ts. Work through the steps in order and run the type checker and tests after each. If you are starting fresh, skip this page and read prisma. Prisma 8 is a release candidate with a different API and is a separate migration, covered by Prisma’s own upgrade guide.
Check the toolchain first
Prisma 7 requires Node 20.19+, 22.12+, or 24+, TypeScript 5.4+, and an ESM project: "type": "module" in package.json, and "module": "ESNext" with "moduleResolution": "bundler" in tsconfig.json. Pin both packages: npm install prisma@7 @prisma/client@7. The prisma latest tag now resolves to the Prisma 8 release candidate.
Swap the generator and fix imports
generator client {
provider = "prisma-client"
output = "../src/generated/prisma"
}prisma-clientreplaces the deprecatedprisma-client-js.outputis mandatory and must be outsidenode_modules.- Remove
driverAdaptersfrompreviewFeaturesand dropengineType. - Add the output directory to
.gitignoreand keepprisma generateinpostinstall. - Change every import of
PrismaClientandPrismafrom@prisma/clientto the output path, for example./generated/prisma/client. This includesPrisma.sql,Prisma.join, andPrisma.raw(prisma-raw-queries).
Move connection settings into prisma.config.ts
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") },
})- Delete
url,directUrl, andshadowDatabaseUrlfrom the schema datasource.directUrlis gone; use the direct URL asdatasource.url. - Prisma 7 does not load
.envfiles. Importdotenv/configor run Node with--env-file.
Install an adapter and re-check pool settings
import { PrismaPg } from "@prisma/adapter-pg"
import { PrismaClient } from "./generated/prisma/client"
export const prisma = new PrismaClient({
adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }),
})See prisma-client for the adapter for each database. Three behavior changes follow from the driver taking over:
- Pool defaults come from
pg, not Prisma. There is no connection timeout by default, andconnection_limitandpool_timeoutURL parameters are ignored; see prisma-pooling. - TLS certificates are now validated. A self-signed certificate that worked before needs a CA, or
ssl: { rejectUnauthorized: false }in development only. - Accelerate users pass
accelerateUrland use no adapter; never give an Accelerate URL to an adapter.
Update scripts and commands
migrate devanddb pushno longer runprisma generateor seed scripts. Runprisma generateandprisma db seedyourself, and drop--skip-generateand--skip-seed.migrate diffreplaced--from-urland--to-urlwith--from-config-datasourceand--to-config-datasource. The shadow database URL now comes from the config; see prisma-migrations.
Replace removed features
$usemiddleware is removed. Port each handler to aqueryextension scoped to the model and operation; see prisma-client.- The Metrics API is removed.
- MongoDB is not supported in Prisma 7. Stay on Prisma 6 for MongoDB projects.