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-client replaces the deprecated prisma-client-js. output is mandatory and must be outside node_modules.
  • Remove driverAdapters from previewFeatures and drop engineType.
  • Add the output directory to .gitignore and keep prisma generate in postinstall.
  • Change every import of PrismaClient and Prisma from @prisma/client to the output path, for example ./generated/prisma/client. This includes Prisma.sql, Prisma.join, and Prisma.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, and shadowDatabaseUrl from the schema datasource. directUrl is gone; use the direct URL as datasource.url.
  • Prisma 7 does not load .env files. Import dotenv/config or 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, and connection_limit and pool_timeout URL 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 accelerateUrl and use no adapter; never give an Accelerate URL to an adapter.

Update scripts and commands

  • migrate dev and db push no longer run prisma generate or seed scripts. Run prisma generate and prisma db seed yourself, and drop --skip-generate and --skip-seed.
  • migrate diff replaced --from-url and --to-url with --from-config-datasource and --to-config-datasource. The shadow database URL now comes from the config; see prisma-migrations.

Replace removed features

  • $use middleware is removed. Port each handler to a query extension 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.