Change8

7.0.0

Breaking Changes
📦 prismaView on GitHub →
9 breaking3 features🔧 14 symbols

Summary

Prisma 7.0.0 makes the ESM-based Prisma Client the default, significantly reducing bundle sizes and improving performance. It introduces a mandatory configuration file (prisma.config.ts) and requires explicit driver adapter injection and output paths.

⚠️ Breaking Changes

  • The ESM Prisma Client is now the default; 'prisma-client-js' provider is replaced by 'prisma-client'.
  • PrismaClient constructor now requires an 'adapter' or 'accelerateUrl'. Default empty constructors are no longer supported.
  • The 'output' path in schema.prisma is now mandatory; generated files no longer reside in node_modules by default.
  • Implicit commands (post-install generate, migrate-triggered generate/seed) have been removed.
  • MongoDB is currently unsupported in version 7.0.0.
  • Automatic loading of environment variables by the Prisma CLI has been removed.
  • The 'prisma.config.ts' file is now required for introspection and migration tasks.
  • Removed support for 'datasources', 'datasourceUrl', and 'directUrl' in the PrismaClient constructor and schema.
  • Renamed several Driver Adapter classes for naming standardization.

Migration Steps

  1. Update 'provider' in schema.prisma from 'prisma-client-js' to 'prisma-client'.
  2. Add an 'output' path to the generator block in schema.prisma (e.g., output = '../src/generated/prisma').
  3. Create a 'prisma.config.ts' file and move 'url' and 'shadowDatabaseUrl' from the schema to this config.
  4. Update PrismaClient instantiation to pass a driver adapter (e.g., new PrismaClient({ adapter })).
  5. Update import statements to point to the new custom 'output' directory.
  6. Manually run 'prisma generate' and 'prisma seed' as they are no longer triggered implicitly.
  7. Install 'dotenv' or similar to manually load environment variables before running Prisma CLI commands.

✨ New Features

  • New Rust-free/ESM Prisma Client as the default provider, offering 90% smaller bundles and up to 3x faster queries.
  • Introduction of 'prisma.config.ts' for centralized project configuration.
  • New required package '@prisma/client-runtime-utils' for users staying on 'prisma-client-js' with custom output paths.

🔧 Affected Symbols

PrismaClientprisma-clientprisma-client-jsPrismaBetterSQLite3PrismaBetterSqlite3PrismaD1HTTPPrismaD1HttpPrismaLibSQLPrismaLibSqlPrismaNeonHTTPPrismaNeonHttpdefineConfiglistLocalDatabases@prisma/client-runtime-utils