Prisma 4.6.0stable Released Nov 08, 2022
Impact Score: 5/10

Prisma 4.6.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.

Compatibility not verified β€” check source notes
$ npm install --save-dev --save-exact [email protected]
πŸ“„ .MD
⚑ Executive Summary (TL;DR)

Prisma 4.6.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 (4)

  • Add duration to mongo logging
  • referentialIntegrity/relationMode preview feature (`referentialIntegrity = "prisma"`): Make `NoAction` a synonym/alias of `Restrict` for the emulation, for all databases except PostgreSQL & SQLite.
  • Schema: add validation for datasource property referentialIntegrity & relationMode, so only one can be set.
  • **Coordinating workflows executed via a set of isolated functions or services** spreads that coordination logic across these services instead of keeping it centralized and maintainable. This adds unnecessary overhead and clutter to your business logic.

⚑ Performance & Enhancements (3)

  • All criteria of the filter must be on scalar fields (unique ***or*** non-unique) of the same model you're querying
  • All criteria must use the equal's filter, whether that's via the shorthand or explicit syntax (`where: { field: <val>, field1: { equals: <val> } }`)
  • **Optimizing the data access layer for scaling performance** often involves projecting data into denormalized views, or caching. These methods come with complex logic to figure out strategies for cache invalidation or preventing to use stale data.
πŸ“„ 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.6.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/4.6.0) about the release.** 🌟 ## Highlights ### Interactive Transactions for Prisma Data Proxy (Preview) In [3.8.0](https://github.com/prisma/prisma/releases/tag/3.8.0), we disabled the `interactiveTransactions` [Preview feature](https://www.prisma.io/docs/about/prisma/releases#preview) when using the Prisma Data Proxy. This was because the API was not yet supported. In this release, we're removing the limitation. You can now try the Preview version of [interactive transactions](https://www.prisma.io/docs/concepts/components/prisma-client/transactions#interactive-transactions-in-preview) with the Prisma Data Proxy. Re-generate Prisma Client using `prisma generate --data-proxy` after enabling the Preview feature. **Note**: The `interactiveTransactions` Preview feature flag is still needed. We will remove this in a future version when the feature is stable. Try it out and let us know your thoughts in our [interactive transactions feedback GitHub issue](https://github.com/prisma/prisma/issues/8664). ### Native database level upserts for PostgreSQL, SQLite, and CockroachDB Prisma’s upsert is one of its most powerful and most convenient APIs. In this release, Prisma will now default to the native database upsert for PostgreSQL, SQLite, and CockroachDB whenever possible. Prisma will use the native database upsert if: - There are no nested queries in the `upsert`'s `create` and `update` [options](https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#upsert-1) - The query modifies only one model - There is only one unique field in the `upsert`'s `where` option - The unique field in the `where` option and the unique field in the `create` option have the same value Prisma Client's [`upsert`](https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#upsert) operation was implemented on a Prisma-level and did not use the native database implementations like, e.g., `INSERT .. ON CONFLICT .. UPDATE SET`. This allowed Prisma to also upsert nested queries. The Prisma-implementation came at a cost. In some scenarios, it was more likely for a transaction to roll back because of a conflict when multiple `upsert` operations were being executed in parallel, and the multiple queries often took longer than the native database query would have taken. Try it out and let us know what you think. If you run into any issues, don't hesitate to create a [GitHub issue](https://github.com/prisma/prisma/issues/new?assignees=&labels=kind%2Fbug&template=bug_report.yml). ### Relation Mode improvements (Preview) In [4.5.0](https://github.com/prisma/prisma/releases/tag/4.5.0), we renamed the "Referential Integrity" Preview feature to "Relation Mode". We also changed the `datasource` property name of the feature to `relationMode`. In this release, we fixed all remaining known bugs of `relationMode = "prisma"` and cleaned up our documentation. You can now read about [Relation mode](https://www.prisma.io/docs/concepts/components/prisma-schema/relations/relation-mode) on its [own documentation page](https://www.prisma.io/docs/concepts/components/prisma-schema/relations/relation-mode) which is up to date with the implementation. If you encounter any problems [please comment on our feedback issue](https://github.com/prisma/prisma/issues/9380). We plan to make this [Generally Available](https://www.prisma.io/docs/about/prisma/releases#generally-available-ga) soon. ### `extendedWhereUnique` improvements (Preview) In [4.5.0](https://github.com/prisma/prisma/releases/tag/4.5.0), we introduced the `extendedWhereUnique` Preview feature to allow filtering for non-unique properties in unique where queries. In this release, we're adding new rules to decide when concurrent `findUnique` queries get batched into a `findMany` query. Unfortunately, we forgot to adapt our `findUnique` [query batch optimization](https://www.prisma.io/docs/guides/performance-and-optimization/query-optimization-performance#solving-the-n1-problem), which turns multiple concurrent `findUnique` queries into a single `findMany` query when possible β€” [GitHub issue](https://github.com/prisma/prisma/issues/15934). Therefore, `findUnique` queries will get batched into a `findMany` query if: - All criteria of the filter must be on scalar fields (unique ***or*** non-unique) of the same model you're querying - All criteria must use the equal's filter, whether that's via the shorthand or explicit syntax (`where: { field: <val>, field1: { equals: <val> } }`) Conversely, suppose the filter object contains any boolean operators, relation filters, or scalar filters that are ****not**** using `equals`. Prisma will fall back to executing the `findUnique` queries independently. Let us know your thoughts and share your feedback on the Preview feature in this [GitHub issue](https://github.com/prisma/prisma/issues/15837). ## Fixes and improvements ### Prisma Client - [upsert across HTTP requests has a race condition](https://github.com/prisma/prisma/issues/3242) - [Client tests for Vitess, with `relationMode=prisma`](https://github.com/prisma/prisma/issues/6927) - [Concurrent relation upserts conflict](https://github.com/prisma/prisma/issues/9751) - [`upsert()` should do ON CONFLICT DO UPDATE/NOTHING in postgresql](https://github.com/prisma/prisma/issues/9972) - [Cannot insert Floats (β‰₯9.223372037e18 and <1e21) or (>-1e21 and ≀-9.223372037e18)](https://github.com/prisma/prisma/issues/12651) - [Always serialize float fields in exponent notation](https://github.com/prisma/prisma/issues/13317) - [Postgres integer column silently overflows to bad value](https://github.com/prisma/prisma/issues/13913) - [Add duration to mongo logging](https://github.com/prisma/prisma/issues/14378) - [upsert(): Unique constraint on DateTime sqlite](https://github.com/prisma/prisma/issues/14584) - ["Unique constraint failed on the fields" when using upsert](https://github.com/prisma/prisma/issues/14868) - [using connect in interactive transaction fails](https://github.com/prisma/prisma/issues/15044) - [MongoDB does not log queries with `binary` Engine](https://github.com/prisma/prisma/issues/15084) - [[MongoDb] Query logger produces incorrect output](https://github.com/prisma/prisma/issues/15467) - [Float values around 2^63 get interpreted as invalid intergers and throw a graphql error](https://github.com/prisma/prisma/issues/15551) - [referentialIntegrity/relationMode preview feature (`referentialIntegrity = "prisma"`): Make `NoAction` a synonym/alias of `Restrict` for the emulation, for all databases except PostgreSQL & SQLite.](https://github.com/prisma/prisma/issues/15655) - [Client: In 1:1,1:n, m:n relations using `OnDelete: SetNull` with `referentialIntegrity = "prisma"` `user.delete()` should fail, but succeeds.](https://github.com/prisma/prisma/issues/15683) - [calling findUnique concurrently on a model with a compound unique constraint causes it to return null](https://github.com/prisma/prisma/issues/15934) - [Support interactive transactions in the Data Proxy](https://github.com/prisma/prisma/issues/16177) ### Prisma - [Re-Introspection: `referentialIntegrity = prisma` not respected when using `@@map()`](https://github.com/prisma/prisma/issues/11022) - [Validation fails to detect invalid `SetNull` referential action referencing non-optional fields](https://github.com/prisma/prisma/issues/14673) - [Schema: add validation for datasource property referentialIntegrity & relationMode, so only one can be set.](https://github.com/prisma/prisma/issues/15735) - [Create TypeScript tests for #15655](https://github.com/prisma/prisma/issues/15882) - [`referentialIntegrity` policy is lost during re-introspection](https://github.com/prisma/prisma/issues/16007) - [Relation fields are removed after npx prisma db pull](https://github.com/prisma/prisma/issues/16100) - [Re-introspection should not remove relations when relationMode="prisma"](https://github.com/prisma/prisma/issues/16130) ### Language tools (e.g. VS Code) - [Schema autocompletion intellisense don't match custom datasource name](https://github.com/prisma/language-tools/issues/1223) ## Design Partner Program Are you building data-intensive applications in serverless environments using Prisma? If so, you should join our Design Partner Program to help us build the tools that best fit your workflows! The Design Partner Program aims to help development teams solve operational, data-related challenges in serverless environments. Specifically, we’re looking to build tools that help with the following problems: - Solutions to **listen and react to database changes in real time** are either brittle or too complex to build and operate. - **Coordinating workflows executed via a set of isolated functions or services** spreads that coordination logic across these services instead of keeping it centralized and maintainable. This adds unnecessary overhead and clutter to your business logic. - **Optimizing the data access layer for scaling performance** often involves projecting data into denormalized views, or caching. These methods come with complex logic to figure out strategies for cache invalidation or preventing to use stale data. - **Building web applications on modern Serverless platforms such as Vercel or Netlify often breaks down** as soon as you need to execute on any of the topics listed above. This pushes to re-platform on a traditional infrastructure, delaying projects, and losing productivity benefits offered by Vercel or Netlify. [**Submit an application**](https://docs.google.com/forms/d/e/1FAIpQLSdfadMO7qVOMlOgmeYevpM-olpjku2-3sVzMvVQiHITmZf4dA/viewform) through our application form to join the Prisma Design Partner Program to take advantage of new features that you won't have to build or maintain yourselves. ## 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/o_e_KCqXaRo) live stream. The stream takes place [on YouTube](https://youtu.be/o_e_KCqXaRo) on **Thursday, November 10** at **5 pm Berlin | 8 am San Francisco**. ### Credits Huge thanks to @cmd-johnson for helping!