Skip to content
verdict:

Prisma 7.0.0

featured

warning: action required

7 breaking changes4 key points

Prisma 7 makes the Rust-free ESM client the default and removes legacy options, so review breaking changes.

summary · from the release notes only · claude-haiku-5-5 · prompt v7

breaking changesall cited, each with a fix

breaking[1]: PrismaClient must now be created with a driver adapter or accelerateUrl, and the no-argument form is removed.

In v7, we've moved to requiring users pass either an adapter or accelerteUrl when creating a new instance of PrismaClient.

help: Pass an adapter such as PrismaPg, or accelerateUrl for Prisma Accelerate, when creating PrismaClient.

breaking[2]: The datasourceUrl option of PrismaClient is removed.

new PrismaClient({datasourceUrl: ..}) support has been removed

help: Remove datasourceUrl and pass an adapter or accelerateUrl instead.

breaking[3]: The generated Client and project types now require an output path in the generator block.

When running prisma generate, the generated Client runtime and project types will now **require** a output path to be set in your project’s main schema.prisma. We recommend that they be generated inside of your project’s src directory to ensure that your existing tools are able to consume them like any other piece of code you might have.

help: Set output in the generator block, then import PrismaClient from the generated folder.

breaking[4]: prisma generate and prisma seed no longer run implicitly after install or during prisma migrate.

This behaviour has been removed in favor of explicitly requiring commands to be run by users.

help: Run prisma generate and prisma seed explicitly in your scripts or workflow.

breaking[5]: The prisma block in package.json is no longer read for the schema path or seed script.

### Removed support for prisma keyword in package.json

help: Move the schema and seed settings into prisma.config.ts.

breaking[6]: Environment variables are no longer loaded automatically when the Prisma CLI runs.

As part of the move to Prisma config, we’re no longer automatically loading environment variables when invoking the Prisma CLI. Instead, developers can utilize libraries like dotenv to manage their environment variables and load them as they need. This means you can have dedicated local environment variables or ones set only for production. This removes any accidental loading of environment variables while giving developers full control.

help: Load your .env files yourself, for example with dotenv, before running Prisma commands.

breaking[7]: MongoDB is not supported in Prisma 7.

Currently, MongoDB is not supported in Prisma 7. For folks using MongoDB, please stay on Prisma v6. We aim to add support for MongoDB in a future release.

help: Stay on Prisma v6 if you use MongoDB.

key points

release-notesgithub.com/prisma/orm · 346 lines
  1. Today, we are excited to share the `7.0.0` stable release 🎉
  2. **🌟 Star this repo for notifications about new releases, bug fixes & features — and [follow us on X](https://pris.ly/x)!**
  3. # Highlights
  4. Over the past year we focused on making it simpler and faster to build applications with Prisma, no matter what tools you use or where you deploy, with exceptional developer experience at it’s core. This release makes many features introduced over the past year as the new defaults moving forward.
  5. ## Prisma ORM
  6. ### ESM Prisma Client as the default
  7. The Rust-free/ESM Prisma Client has been in the works for some time now, all the way [back to v6.16.0](https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-6), with early iterations being available for developers to adopt. Now with version 7.0, we’re making this the default for all new projects. With this, developers are able to get:
  8. - ~90% smaller bundle sizes
  9. - Up to 3x faster queries
  10. - Significantly simpler deployments
  11. Adopting the new client is as simple as swapping the `prisma-client-js` provider for `prisma-client` in your main `schema.prisma` :
  12. ```diff
  13. // schema.prisma
  14. generator client {
  15. - provider = "prisma-client-js"
  16. + provider = "prisma-client"
  17. }
  18. ```
  19. ### Prisma Client changes
  20. In v7, we've moved to requiring users pass either an adapter or `accelerteUrl` when creating a new instance of `PrismaClient`.
  21. For Driver Adapters
  22. ```tsx
  23. import { PrismaClient } from './generated/prisma/client';
  24. import { PrismaPg } from '@prisma/adapter-pg';
  25. const adapter = new PrismaPg({
  26. connectionString: process.env.DATABASE_URL
  27. });
  28. const prisma = new PrismaClient({ adapter });
  29. ```
  30. For other databases:
  31. ```tsx
  32. // If using SQLite
  33. import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3';
  34. const adapter = new PrismaBetterSqlite3({
  35. url: process.env.DATABASE_URL || 'file:./dev.db'
  36. })
  37. // If using MySql
  38. import { PrismaMariaDb } from '@prisma/adapter-mariadb';
  39. const adapter = new PrismaMariaDb({
  40. host: "localhost",
  41. port: 3306,
  42. connectionLimit: 5
  43. });
  44. ```
  45. We’ve also removed support for additional options when configuring your Prisma Client
  46. - `new PrismaClient({ datasources: .. })` support has been removed
  47. - `new PrismaClient({datasourceUrl: ..})` support has been removed
  48. - `new PrismaClient()` support has been removed
  49. - `new PrismaClient({})` support has been removed
  50. For Prisma Accelerate users:
  51. ```tsx
  52. import { PrismaClient } from "./generated/prisma/client"
  53. import { withAccelerate } from "@prisma/extension-accelerate"
  54. const prisma = new PrismaClient({
  55. accelerateUrl: process.env.DATABASE_URL,
  56. }).$extends(withAccelerate())
  57. ```
  58. ### Generated Client and types move out of `node_modules`
  59. When running `prisma generate`, the generated Client runtime and project types will now **require** a `output` path to be set in your project’s main `schema.prisma`. We recommend that they be generated inside of your project’s `src` directory to ensure that your existing tools are able to consume them like any other piece of code you might have.
  60. ```groovy
  61. // schema.prisma
  62. generator client {
  63. provider = "prisma-client"
  64. // Generate my Client and Project types
  65. output = "../src/generated/prisma"
  66. }
  67. ```
  68. Update your code to import `PrismaClient` from this generated output:
  69. ```tsx
  70. // Import from the generated prisma client
  71. import { PrismaClient } from './generated/prisma/client';
  72. ```
  73. For developers who still need to stay on the `prisma-client-js` but are using the new `output` option, theres’s a new required package, `@prisma/client-runtime-utils` , which needs to be installed:
  74. ```bash
  75. # for prisma-client-js users only
  76. npm install @prisma/client-runtime-utils
  77. ```
  78. ### Removal of implicit Prisma commands
  79. In previous releases, Prisma would run `generate` and `seed` in various situations:
  80. - post-install hook would run `prisma generate`
  81. - `prisma migrate` would run `prisma generate` and `prisma seed`
  82. This behaviour has been removed in favor of explicitly requiring commands to be run by users.
  83. ### Removal of `prisma generate` flags
  84. For `prisma generate` , we’ve removed a few flags that were no longer needed:
  85. - `prisma generate --data-proxy`
  86. - `prisma generate --accelerate`
  87. - `prisma generate --no-engine`
  88. - `prisma generate --allow-no-models`
  89. ### Removal of `prisma db` flags
  90. For `prisma db`, we’ve removed the following flag:
  91. - `prisma db pull --local-d1`
  92. This parameter no longer exists but equivalent functionality can be implemented by defining a config file with a connection string for the local D1 database. We provide a helper function listLocalDatabases in the D1 adapter to simplify the migration:
  93. ```ts
  94. import { defineConfig } from '@prisma/config'
  95. import { listLocalDatabases } from '@prisma/adapter-d1'
  96. export default defineConfig({
  97. datasource: {
  98. url: `file://${listLocalDatabases().pop()}`,
  99. },
  100. })
  101. ```
  102. ### Removal of `prisma migrate` flags
  103. For `prisma migrate diff`, we’ve removed the following flags:
  104. - `prisma --[from/to]-schema-datamodel`
  105. - This is now replaced with just `--[from/to]-schema`. The usage is otherwise the same.
  106. - `prisma --[from/to]-url`, `prisma --[from/to]-schema-datasource`
  107. - These are now replaced with `--[from/to]-config-datasource`. The user is expected to populate the datasource in the config file and use the new flag. We no longer support diffing two different URLs/datasources, since only one config can be used at a time.
  108. - `prisma --[from/to]-local-d1`
  109. - These are now replaced with `--[from/to]-config-datasource`. The user is expected to populate the datasource in the config file and use the new flag with a minor complication due to the fact that it needs to reference the local D1 database. Our `listLocalDatabases` helper function can be used for that, analogously to the `db pull --local-d1` example above (where the user sets the datasource URL to `file://${listLocalDatabases().pop()}`)
  110. ### MongoDB support in Prisma 7
  111. Currently, MongoDB is not supported in Prisma 7. For folks using MongoDB, please stay on Prisma v6. We aim to add support for MongoDB in a future release.
  112. ### Driver Adapter naming updates
  113. We’ve standardized our naming conventions for the various driver adapters internally. The following driver adapters have been updated:
  114. - `PrismaBetterSQLite3` ⇒ `PrismaBetterSqlite3`
  115. - `PrismaD1HTTP` ⇒ `PrismaD1Http`
  116. - `PrismaLibSQL` ⇒ `PrismaLibSql`
  117. - `PrismaNeonHTTP` ⇒ `PrismaNeonHttp`
  118. ### Schema and config file updates
  119. As part of a larger change in how the Prisma CLI reads your project configuration, we’ve updated what get’s set the schema, and what gets set in the `prisma.config.ts` . Also as part of this release, `prisma.config.ts` is now required for projects looking to perform introspection and migration.
  120. **Schema changes**
  121. - `datasource.url` is now configured in the config file
  122. - `datasource.shadowDatabaseUrl` is now configured in the config file
  123. - `datasource.directUrl` has been made unnecessary and has removed
  124. - `generator.runtime=”react-native”` has been removed
  125. For early adopters of the config file, a few things have been removed with this release
  126. - `engine: 'js'| 'classic'` has been removed
  127. - `adapter` has been removed
  128. A brief before/after:
  129. ```groovy
  130. // schema.prisma
  131. datasource db {
  132. provider = "postgresql"
  133. url = ".."
  134. directUrl = ".."
  135. shadowDatabaseUrl = ".."
  136. }
  137. ```
  138. ```tsx
  139. // ./prisma.config.ts
  140. export default defineConfig({
  141. datasource: {
  142. url: '..',
  143. shadowDatabaseUrl: '..',
  144. }
  145. })
  146. ```
  147. ### Explicit loading of environment variables
  148. As part of the move to Prisma config, we’re no longer automatically loading environment variables when invoking the Prisma CLI. Instead, developers can utilize libraries like `dotenv` to manage their environment variables and load them as they need. This means you can have dedicated local environment variables or ones set only for production. This removes any accidental loading of environment variables while giving developers full control.
  149. ### Removed support for `prisma` keyword in `package.json`
  150. In previous releases, users could configure their schema entry point and seed script in a `prisma` block in the `package.json` of their project. With the move to `prisma.config.ts`, this no longer makes sense and has been removed. To migrate, use the Prisma config file instead:
  151. ```json
  152. {
  153. "name": "my-project",
  154. "version": "1.0.0",
  155. "prisma": {
  156. "schema": "./custom-path-to-schema/schema.prisma",
  157. "seed": "tsx ./prisma/seed.ts"
  158. }
  159. }
  160. ```
  161. ```tsx
  162. import 'dotenv/config'
  163. import { defineConfig, env } from "prisma/config";
  164. export default defineConfig({
  165. schema: "prisma/schema.prisma",
  166. migrations: {
  167. seed: "tsx prisma/seed.ts"
  168. },
  169. datasource: {...},
  170. });
  171. ```
  172. ### Removed Client Engines:
  173. We’ve removed the following client engines:
  174. - `LibraryEngine` (`engineType = "library"`, the Node-API Client)
  175. - `BinaryEngine` (`engineType = "binary"`, the long-running executable binary)
  176. - `DataProxyEngine` and `AccelerateEngine` (Accelerate uses a new `RemoteExecutor` now)
  177. - `ReactNativeEngine`
  178. ### Deprecated metrics feature has been removed
  179. We deprecated the previewFeature `metrics` some time ago, and have removed it fully for version 7. If you need metrics related data available, you can use the underlying driver adapter itself, like the Pool metric from the Postgres driver.
  180. ### Miscellaneous
  181. - [#28493](https://github.com/prisma/prisma/pull/28493): Stop shimming `WeakRef` in Cloudflare Workers. This will now avoid any unexpected memory leaks.
  182. - [#28297](https://github.com/prisma/prisma/pull/28297): Remove hardcoded URL validation. Users are now required to make sure they don’t include sensitive information in their config files.
  183. - [#28273](https://github.com/prisma/prisma/pull/28273): Removed Prisma v1 detection
  184. - [#28343](https://github.com/prisma/prisma/pull/28343): Remove undocumented `--url` flag from `prisma db pull`
  185. - [#28286](https://github.com/prisma/prisma/pull/28286): Remove deprecated `prisma introspect` command.
  186. - [#28480](https://github.com/prisma/prisma/pull/28480): Rename `/wasm` to `/edge`
  187. - This change only affects `prisma-client-js`
  188. - Before:
  189. - `/edge` → meant “for Prisma Accelerate”
  190. - `/wasm` → meant “for Edge JS runtimes (e.g., Cloudflare, Vercel Edge)”
  191. - After:
  192. - `/edge` → means “for Edge JS runtimes (e.g., Cloudflare, Vercel Edge)”
  193. - The following Prisma-specific environment variables have been removed
  194. - `PRISMA_CLI_QUERY_ENGINE_TYPE`
  195. - `PRISMA_CLIENT_ENGINE_TYPE`
  196. - `PRISMA_QUERY_ENGINE_BINARY`
  197. - `PRISMA_QUERY_ENGINE_LIBRARY`
  198. - `PRISMA_GENERATE_SKIP_AUTOINSTALL`
  199. - `PRISMA_SKIP_POSTINSTALL_GENERATE`
  200. - `PRISMA_GENERATE_IN_POSTINSTALL`
  201. - `PRISMA_GENERATE_DATAPROXY`
  202. - `PRISMA_GENERATE_NO_ENGINE`
  203. - `PRISMA_CLIENT_NO_RETRY`
  204. - `PRISMA_MIGRATE_SKIP_GENERATE`
  205. - `PRISMA_MIGRATE_SKIP_SEED`
  206. ### Mapped enums
  207. If [you followed along on twitter](https://x.com/prisma/status/1988970132690071600), you will have seen that we teased a highly-request user feature was coming to v7.0. That highly-requested feature is…. mapped emuns! We now support the `@map` attribute for enum members, which can be used to set their expected runtime values
  208. ```groovy
  209. enum PaymentProvider {
  210. MixplatSMS @map("mixplat/sms")
  211. InternalToken @map("internal/token")
  212. Offline @map("offline")
  213. @@map("payment_provider")
  214. }
  215. ```
  216. ```tsx
  217. export const PaymentProvider: {
  218. MixplatSMS: 'mixplat/sms'
  219. InternalToken: 'internal/token'
  220. Offline: 'offline'
  221. }
  222. ```
  223. ## New Prisma Studio comes to the CLI
  224. We launched a new version of Prisma Studio to our Console and VS Code extension a while back, but the Prisma CLI still shipped with the older version.
  225. Now, with v7.0, we’ve updated the Prisma CLI to include the new Prisma Studio. Not only are you able to inspect your database, but you get rich visualization to help you understand connected relationships in your database. It’s customizable, much smaller, and can inspect remote database by passing a `--url` flag. This new version of Prisma Studio is not tied to the Prisma ORM, and establishes a new foundation for what comes next.
  226. Currently, the new studio only supports Postgres, MySQL, and SQLite, with support for other databases coming in a future release.
  227. For issues related to Prisma Studio, please direct them to the [Studio repo on github](https://github.com/prisma/studio).
  228. ![ScreenRecording2025-11-18at7 40 46PM-ezgif com-video-to-gif-converter](https://github.com/user-attachments/assets/0509b554-cbc6-48cc-adc5-ba491759895c)
  229. ## Prisma Postgres
  230. [Prisma Postgres](https://www.prisma.io/postgres) is our managed Postgres service, designed with the same philosophy of great DX that has guided Prisma for close to a decade. It works great with serverless, it’s fast, and with simple pricing and a generous free tier. Here’s what’s new:
  231. ### Connection Pooling Changes with Prisma Accelerate
  232. With support for connection pooling being added natively to Prisma Postgres, Prisma Accelerate now serves as a dedicated caching layer. If you were using Accelerate for the connection pooling features, don’t worry! Your existing connection string via Accelerate will continue to work, and you can switch to the new connection pool when you’re ready.
  233. ### Simplified connection flow
  234. We've made connecting to Prisma Postgres even simpler. Now, when you go to connect to a database, you’ll get new options to enable connection pooling, or to enable Prisma Accelerate for caching. Below, you’ll get code snippets for getting things configured in your project right away.
  235. ![Clipboard-20251119-110343-691](https://github.com/user-attachments/assets/172b43ee-70b3-43c7-a3ca-2cc12873d1a4)
  236. ### Serverless driver
  237. For those who want to connect to Prisma Postgres but are deploying to environments like Cloudflare Workers, we have a new version of the serverless client library to support these runtimes.
  238. - Compatible with Cloudflare Workers, Vercel Edge Functions, Deno Deploy, AWS Lambda, and Bun
  239. - Stream results row-by-row to handle large datasets with constant memory usage
  240. - Pipeline multiple queries over a single connection, reducing latency by up to 3x
  241. - SQL template literals with automatic parameterization and full TypeScript support
  242. - Built-in transactions, batch operations, and extensible type system
  243. [Check out the serverless driver docs](https://www.prisma.io/docs/postgres/database/serverless-driver) for more details
  244. ## Open roles at Prisma
  245. Interested in joining Prisma? We’re growing and have several exciting opportunities across the company for developers who are passionate about building with Prisma. Explore our open positions on our [Careers page](https://www.prisma.io/careers#current) and find the role that’s right for you.
  246. ## Enterprise support
  247. Thousands of teams use Prisma and many of them already tap into our Enterprise & Agency Support Program for hands-on help with everything from schema integrations and performance tuning to security and compliance.
  248. With this program you also get priority issue triage and bug fixes, expert scalability advice, and custom training so that your Prisma-powered apps stay rock-solid at any scale. Learn more or join: https://prisma.io/enterprise.

view on githubimported 2026-09-28 via npm