Impact Score: 5/10
Prisma 4.7.0 β Release Notes & Engineering Impact
Source available β automated, not human-reviewed
Component: prisma Β· Channel: stable. Automated analysis, not a compatibility certification. How this works.
Analysis updated: 2026-11-01.
β‘ Executive Summary (TL;DR)
Prisma 4.7.0. Source highlight: π **Help us spread the word about Prisma by starring the repo or tweeting about the release.** π
Who Does This Impact? (Role-Based Analysis)
π» Software Engineers & Devs
Check the source notes against the package and APIs you use before upgrading.
π Product & Engineering Leads
Use the documented changes to assess relevance to your product; release frequency alone is not a quality measure.
βοΈ DevOps & Security
Verify the target version, runtime requirements and rollback procedure in the official documentation.
β¨ New Features & Capabilities (6)
- `model`: add custom methods or fields to your models
- `client`: add client-level methods to Prisma Client
- `result`: add custom fields to your query results
- Add `Prisma.TransactionClient` to `default-index.d.ts`
- Schema: add deprecation warning for datasource property `referentialIntegrity` (renamed to `relationMode`)
- `relationMode`: make feature GA
π§ Bug Fixes & Patches (5)
- `RangeError: Invalid count value` during `npx prisma generate` with `DEBUG=*` on integration build
- Prisma Client regression bug after upgrading to 4.6.0: `findMany` errors with `PANIC: index out of bounds: the len is 0 but the index is 0`
- Bug(qe): errors don't get logged
- feat: Quick Fix - `relationMode` : missing foreign keys' indexes
- bug(fmt): quick-fixes break with no newline after model in schema
π View Raw Release Notes (Original Developer Log)
π **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v4.7.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/4.7.0) about the release.** π
## Highlights
### Interactive transactions are now Generally Available
After an extensive Preview phase and lots of great feedback from our community, we're excited to announce that `interactiveTransactions` is now [Generally Available](https://www.prisma.io/docs/about/prisma/releases#generally-available-ga) and production ready! π
[Interactive transactions](https://www.prisma.io/docs/concepts/components/prisma-client/transactions#interactive-transactions) allow you to pass an async function into a `$transaction`, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.
Here are some of the feature highlights we've built:
- Support for defining [transaction isolation levels](https://www.prisma.io/docs/concepts/components/prisma-client/transactions#transaction-isolation-level) β from [`4.2.0`](https://github.com/prisma/prisma/releases/tag/4.2.0)
- Support for the Prisma Data Proxy β from [`4.6.0`](https://github.com/prisma/prisma/releases/tag/4.6.0)
Here's an example of an interactive transaction with a `Serializable` isolation level:
```ts
await prisma.$transaction(
async (prisma) => {
// Your transaction...
},
{
isolationLevel: Prisma.TransactionIsolationLevel.Serializable,
maxWait: 5000,
timeout: 10000,
}
)
```
You can now remove the `interactiveTransactions` Preview feature in your schema.
### Relation mode is Generally Available
This release marks `relationMode="prisma"` as stable for our users working with databases that don't rely on foreign keys to manage relations. π
Prismaβs [relation mode](https://www.prisma.io/docs/concepts/components/prisma-schema/relations/relation-mode) started as a way to support PlanetScale which does not allow you to create foreign keys for better online migration support. We transformed that into our _Referential Integrity Emulation_ in [`3.1.1`](https://github.com/prisma/prisma/releases/tag/3.1.1) when we realised that more users could benefit from it, and then integrated it as the default mode for MongoDB, which generally does not *have* foreign keys. Prisma needed to use emulation to give the same guarantees.
We then realized the feature was more than just referential integrity and affected how relations work. To reflect this, we renamed the feature to relation mode and the `datasource` property to `relationMode` in [`4.5.0`](https://github.com/prisma/prisma/releases/tag/4.5.0)
#### Index warnings for `relationMode = "prisma"`
In this release, we've added a warning to our Prisma schema validation that informs you that the lack of foreign keys might result in slower performance β and that you should add an `@@index` manually to your schema to counter that. This ensures your queries are equally fast in relation mode `prisma` as they are with foreign keys.
> With `relationMode = "prisma"`, no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to slower performance when querying these fields. We recommend manually adding an index.
We also added a fix to our [VS Code extension](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) to help adding the suggested index with minimal effort:

If you are currently using the Preview feature flag to enable relation mode, you can now remove `referentialIntegrity` from the `previewFeatures` in your `generator client` block in your Prisma schema.
For more information, check out our [updated relation mode documentation](https://www.prisma.io/docs/concepts/components/prisma-schema/relations/relation-mode).
### Prisma Client Extensions (Preview)
This release adds Preview support for Prisma Client Extensions. This feature introduces new capabilities to customize and extend Prisma Client. Today we are opening up four areas for extending Prisma Client:
- `model`: add [custom methods or fields](https://prisma.io/docs/concepts/components/prisma-client/client-extensions/model) to your models
- `client`: add [client-level methods to Prisma Client](https://prisma.io/docs/concepts/components/prisma-client/client-extensions/client)
- `result`: add [custom fields to your query results](https://prisma.io/docs/concepts/components/prisma-client/client-extensions/result)
- `query`: create [custom Prisma Client queries](https://prisma.io/docs/concepts/components/prisma-client/client-extensions/query)
Prisma Client Extensions are self-contained scripts that can tweak the behavior of models, queries, results, and the client (Prisma Client) as a whole. You can associate a single or multiple extensions with an extended client to mix and match Prisma to your needs.
Prisma Client Extensions enables many use cases such as defining virtual fields, custom validation, and custom queries.
It also enables you to [share your client extensions](https://prisma.io/docs/concepts/components/prisma-client/client-extensions/shared-extensions) with others and [import client extensions developed by others](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions/shared-extensions#install-a-packaged-extension) into your project.
For example, given the following schema:
```prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["clientExtensions"]
}
model User {
id Int @id @default(autoincrement())
email String @unique
firstName String?
lastName String
}
```
You can create a computed field called `fullName` as follows:
```ts
import { PrismaClient } from "@prisma/client"
const prisma = new PrismaClient()
.$extends({
result: {
user: {
fullName: {
// the dependencies
needs: { firstName: true, lastName: true },
compute(user) {
// the computation logic
return `${user.firstName} ${user.lastName}`
},
},
},
},
})
```
We're excited to see what you build with them! For more information, check out our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions) and let us know what you think in this [GitHub issue](https://github.com/prisma/prisma/issues/16500).
### Multi-schema support for PostgreSQL (Preview)
We're pleased to announce that this release adds support for multi-schema support for PostgreSQL. The ability to query and manage multiple database schemas has been a long-standing feature request from our community.
This release adds support for the following:
- Introspecting databases that organize objects in multiple database schemas
- Managing multi-schema database setups directly from Prisma schema
- Generating migrations that are database schema-aware with Prisma Migrate
- Querying across multiple database schemas with Prisma Client
If you already have a PostgreSQL database using multiple schemas, you can quickly get up and running using `prisma db pull` β on enabling the Preview feature and specifying the schemas in the `datasource` block similar to the example below.
You can get started with defining multiple schemas in your Prisma schema as follows:
```prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
schemas = ["base", "transactional"]
}
model User {
id Int @id
orders Order[]
@@schema("base")
}
model Order {
id Int @id
user User @relation(fields: [id], references: [id])
user_id Int
@@schema("transactional")
}
```
Then generate and apply the changes to your database with `prisma migrate dev`.
We want to thank all our users for helping us design the feature since the early proposal on GitHub up to our current Preview release.
For further details, refer to our [documentation](https://prisma.io/docs/guides/database/multi-schema) and let us know what you think in this [GitHub issue](https://github.com/prisma/prisma/issues/15077).
## Request for feedback
Our Product team is currently running a [survey](https://prisma103696.typeform.com/views-support) for designing [Database Views support](https://github.com/prisma/prisma/issues/678#issuecomment-1330304851) for Prisma and we would appreciate your feedback.
## Fixes and improvements
### Prisma Client
- [`RangeError: Invalid count value` during `npx prisma generate` with `DEBUG=*` on integration build](https://github.com/prisma/prisma/issues/9429)
- [When rejectOnNotFound is used, chaining deeper into a related table still throws if it doesn't find anything](https://github.com/prisma/prisma/issues/10642)
- [Stabilize `referentialIntegrity`](https://github.com/prisma/prisma/issues/10807)
- [Some errors are obfuscated by interactive transactions when using `binary` engine](https://github.com/prisma/prisma/issues/12862)
- [Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired' P2028](https://github.com/prisma/prisma/issues/13713)
- [The error is incorrectly pointed out when using the $transaction method](https://github.com/prisma/prisma/issues/14373)
- [Client: using update + connect throws an error on an idempotent operation](https://github.com/prisma/prisma/issues/14759)
- [findFirstOrThrow / findUniqueOrThrow errors are not reported via `error` event](https://github.com/prisma/prisma/issues/14933)
- [wrong error message/header on multiple table upsert using transaction](https://github.com/prisma/prisma/issues/15433)
- [Args are out of sync with the action type for count when creating prisma middeware](https://github.com/prisma/prisma/issues/15644)
- [βTransaction API error: Transaction not foundβ](https://github.com/prisma/prisma/issues/16050)
- [Add `Prisma.TransactionClient` to `default-index.d.ts`](https://github.com/prisma/prisma/issues/16103)
- [RangeError: Invalid count value during prisma generate](https://github.com/prisma/prisma/issues/16126)
- [Prisma Client regression bug after upgrading to 4.6.0: `findMany` errors with `PANIC: index out of bounds: the len is 0 but the index is 0`](https://github.com/prisma/prisma/issues/16195)
- [`upsert()` with nested selection errors with `called `Option::unwrap()` on a `None` value` in 4.6.0](https://github.com/prisma/prisma/issues/16196)
- [Bug(qe): errors don't get logged](https://github.com/prisma/prisma/issues/16226)
- [Downloading binaries of 4.6.1 fails with wrong sha256 checksum](https://github.com/prisma/prisma/issues/16233)
- [Calling `findUnique` concurrently with different key order causes one of them to return null](https://github.com/prisma/prisma/issues/16267)
- [No way to catch error in `findUniqueOrThrow` via middleware](https://github.com/prisma/prisma/issues/16354)
- [Test implicit m:n in relation mode `prisma` / Reproduction test for prisma#16390](https://github.com/prisma/prisma/issues/16423)
### Prisma
- [[Multi Schema] Same model map different schema](https://github.com/prisma/prisma/issues/15009)
- [Schema: add deprecation warning for datasource property `referentialIntegrity` (renamed to `relationMode`)](https://github.com/prisma/prisma/issues/15689)
- [Error in migration engine. Reason: [migration-engine/connectors/sql-migration-connector/src/sql_renderer/postgres_renderer.rs:944:22] We should only be setting a changed default if there was one on the previous schema and in the next with the same enum. ](https://github.com/prisma/prisma/issues/15705)
- [`db pull` with `multiSchema` error on schema with 2 models with the same table name but in a different schema](https://github.com/prisma/prisma/issues/15800)
- [Prisma 4.6.0 drops and recreates enum field when running db push even if the field has not changed](https://github.com/prisma/prisma/issues/16180)
- [@@map not working on postgress enums starting version 4.6.0](https://github.com/prisma/prisma/issues/16209)
- [`relationMode`: make feature GA](https://github.com/prisma/prisma/issues/16224)
- [Add `SetDefault` validation error with warnings when `provider = "mysql"` and `relationMode = "foreignKeys" | default`](https://github.com/prisma/prisma/issues/16259)
- [Polish `relationMode` validation warning messages ](https://github.com/prisma/prisma/issues/16440)
- [Add linting/validation warnings for `prisma validate` & `prisma format`](https://github.com/prisma/prisma/issues/16441)
### Prisma Migrate
- [What happen with `prisma migrate dev` ](https://github.com/prisma/prisma/issues/16220)
- [Prisma complains when enum types are not declared in alphabetical order](https://github.com/prisma/prisma/issues/16225)
### Language tools (e.g. VS Code)
- [Dim models that are `@@ignore`d and fields that are `@ignore`d](https://github.com/prisma/language-tools/issues/689)
- [Recommend adding indices to foreign keys when `referentialIntegrity = "prisma"`](https://github.com/prisma/language-tools/issues/992)
- [PostgreSQL only: Add autocompletion in the datasource block for `extensions` when `postgresqlExtensions` preview feature is set](https://github.com/prisma/language-tools/issues/1265)
- [language-tools: `relationMode` GA - remove preview feature condition](https://github.com/prisma/language-tools/issues/1282)
- [feat: for `relationMode="prisma"`, for `@relation`: add a warning if there is no index on the field(s)](https://github.com/prisma/language-tools/issues/1296)
- [feat: Quick Fix - `relationMode` : missing foreign keys' indexes](https://github.com/prisma/language-tools/issues/1297)
### Prisma Engines
- [bug(fmt): quick-fixes break with no newline after model in schema](https://github.com/prisma/prisma-engines/issues/3444)
## Credits
Huge thanks to @cmd-johnson, @jsoref, @miguelgargallo for helping!
## Prisma Data Platform
We're working on the Prisma Data Platform β a collaborative environment for connecting apps to databases. It includes the following:
- **Data Browser** for navigating, editing, and querying data
- **Data Proxy** for your database's persistent, reliable, and scalable connection pooling.
- **Query Console** for experimenting with queries
[Try it out](https://cloud.prisma.io/). Let us know what you think!
## πΊ Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/oWjqeU7fowE) live stream.
The stream takes place [on YouTube](https://youtu.be/oWjqeU7fowE) on **Thursday, December 1** at **5 pm Berlin | 8 am San Francisco**.