Change8

7.10.0

📦 prismaView on GitHub →
4 features🐛 18 fixes🔧 13 symbols

Summary

Prisma ORM 7.10.0 enhances compatibility by introducing a package to run Prisma 7 alongside Prisma 8 and improves Prisma Studio's local server security. It also includes numerous bug fixes across Prisma Client and various database adapters.

Migration Steps

  1. To use Prisma 7 alongside Prisma 8, install `@prisma/prisma7@7.10.0` and `prisma@8`.
  2. Use the `prisma7` command (e.g., `npx prisma7 generate`) to interact with Prisma 7.
  3. Prisma 7 now prefers version-specific configuration files like `prisma7.config.ts`. Existing projects with `prisma.config.*` will continue to work without changes.
  4. If you need to dispose of an external MariaDB pool managed by `@prisma/adapter-mariadb`, supply `disposeExternalPool: true`.

✨ New Features

  • Introduced `@prisma/prisma7`, a compatibility package to run Prisma 7 alongside Prisma 8 in the same project.
  • Prisma Studio's local HTTP server now binds explicitly to `127.0.0.1`, rejects requests from non-matching origins, and no longer returns wildcard CORS headers for enhanced security.
  • Result-extension `compute` callbacks now receive the current model name as a typed second argument.
  • Improved OpenTelemetry context for remotely executed queries, ensuring `$on('query')` callbacks run within the matching `db_query` span, events share the same trace, and errors are recorded as span exceptions.

🐛 Bug Fixes

  • Fixed `P2002` errors from nested writes so `meta.modelName` identifies the model where the unique constraint violation occurred, including models using `@@map` and `@@schema`.
  • Fixed automatically batched `findUniqueOrThrow()` calls so every missing record rejects with `P2025`; later misses no longer resolve to `undefined`.
  • Parameter-chunked statements are now executed atomically in a transaction and rolled back if a later chunk fails.
  • Improved interactive transaction cleanup during `$disconnect()`, including transactions whose driver-level startup is still in progress.
  • Prevented transaction cleanup failures after a timeout or backend termination from becoming unhandled promise rejections.
  • Fixed fluent relation queries when relation fields are literally named `select` or `include`.
  • Fixed handling of `Date` and `Uint8Array` values created in other JavaScript realms, such as iframes, jsdom, and Node.js `vm` contexts.
  • Invalid `Date` values passed to `$queryRaw` or `$executeRaw` now throw `PrismaClientValidationError` instead of a generic error.
  • Fixed `moduleFormat` inference for the `prisma-client` generator in TypeScript projects using `module: "node16"` or `"nodenext"`. Generated output now follows the nearest `package.json` `type`, defaulting to CommonJS when absent.
  • Deserialized `Bytes` values now own standalone `ArrayBuffer`s rather than exposing unrelated contents from Node.js's shared `Buffer` pool. This applies to both regular and raw query results.
  • Fixed an incorrect logging context in the remote executor, including Accelerate-backed query execution.
  • MariaDB: Fixed pooled connection leaks during commit, rollback, and failed transaction startup. Connections are now returned with `release()` and transaction-specific listeners are removed before reuse.
  • MariaDB: Added support for bracketed IPv6 addresses in both `mysql://` and `mariadb://` connection strings.
  • MariaDB: Prevented malformed connection strings from exposing embedded passwords in retained debug output and diagnostic reports.
  • PostgreSQL, Neon, and Prisma Postgres Serverless: PostgreSQL deadlocks using SQLSTATE `40P01` are now reported as `P2034` transaction write conflicts.
  • PostgreSQL, Neon, and Prisma Postgres Serverless: PostgreSQL `RESTRICT` violations using SQLSTATE `23001` are now reported as `P2003`, preserving an available field or constraint name.
  • PostgreSQL, Neon, and Prisma Postgres Serverless: `@prisma/adapter-pg` now preserves database constraint names when reporting unique constraint violations through `P2002`.
  • PostgreSQL, Neon, and Prisma Postgres Serverless: Prisma Postgres Serverless now prefers the named constraint for `P2002`, falling back to parsed field names when no constraint name is available.

Affected Symbols