fix(deps): update prisma monorepo to v6 (major) #7149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.22.0->6.3.05.22.0->6.3.05.22.0->6.3.05.18.0->6.3.05.22.0->6.3.05.18.0->6.3.0Release Notes
prisma/prisma (@prisma/adapter-d1)
v6.3.0Compare Source
Today, we are excited to share the
6.3.0stable release 🎉🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release. 🌟
Highlights
Add
limittoupdateMany()anddeleteMany()Previously,
limithas not existed as a valid option in top levelupdateMany()anddeleteMany()queries. In 6.3.0limitis now available in these queries, bringing their features more in line with other query types.You can use
limitlike the following:This will limit the number of deleted users to 100 at maximum.
Sort
generatorfields deterministicallyIn previous version of Prisma ORM, the fields inside of a
generatorblock in your Prisma Schema were not deterministically sorted. This could lead to cases whereprisma db pullcould lead to re-ordering of fields.In 6.3.0, the sorting of fields in this block is now deterministic. You may see re-ordering on the first
prisma db pullafter you upgrade, but it will remain consistent afterwards.Replace
NOT INwithNOT EXISTSfor PostgreSQL relation filtersIn previous versions of Prisma ORM, when using the
noneorsomerelation filters, the SQL queries generated usedNOT IN. In many cases this lead to performance issues as the size of the related table grew. In 6.3.0, we’ve replaced these usages ofINwithEXISTSin order to improve query performance.A special thank you
We'd like to extend our heartfelt thanks to @loren and his team for the collaboration and trust in our enterprise support plan. Working closely with them allowed us to address important issues like #19249 and #17303. Their insights and partnership have been invaluable in improving our product.
If your team could benefit from dedicated support and tailored solutions, learn more about our enterprise support plan.
Fixes and improvements
Prisma Client
takeorlimittoupdateMany()&deleteMany()Prisma
prisma db pullnon-deterministically sorts generator fieldsno entry found for keyerror on views<->model relationsonUpdatedata to the DMMF in@prisma/generator-helperCredits
Huge thanks to @WhyAsh5114 for their contributions to this release!
v6.2.1Compare Source
Today we are releasing the 6.2.1 patch release to address an issue with some of the
omitApipreview feature checks having been accidentally omitted when making the feature GA. Now it is fully functional without the preview feature flag.Changes
v6.2.0Compare Source
Today we're releasing Prisma ORM version 6.2.0 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
We have a number of new features in this version, including support for
jsonandenumfields in SQLite, a newupdateManyAndReturnfunction, support for ULID values, as well as the promotion of theomitfeature from Preview to Generally Availability.Highlights
Excluding fields via
omitis now production-readyOur number one requested feature is out of Preview and Generally Available. In 6.2.0, you no longer need to add
omitApito your list of Preview features:generator client { provider = "prisma-client-js" - previewFeatures = ["omitApi"] }As a refresher:
omitallows you to exclude certain fields from being returned in the results of your Prisma Client queries.You can either do this locally, on a per-query level:
Or globally, to ensure a field is excluded from all queries of a certain model:
For more information on
omit, be sure to check our documentation.jsonandenumfields in SQLitePrevious to this version, you could not define
jsonandenumfields in your Prisma schema when using SQLite. The respective GitHub issues have been among the most popular ones in our repo, so with our new approach to open-source governance, we finally got to work and implemented these.Working with JSON and Enum fields works similarly to other database providers, here’s an example:
Support for auto-generated ULID values
Similar to
cuid2support released in ORM version 6.0.0, we are now adding support for Universally Unique Lexicographically Sortable Identifiers (or short: ULIDs 😄) in version 6.2.0. A ULID value is a 26-character alphanumeric string, e.g.01GZ0GZ3XARH8ZP44A7TQ2W4ZD.With this new feature, you can now create records with auto-generated ULID values for
Stringfields:New batch function:
updateManyAndReturnupdateManyallows you to update many records in your database, but it only returns the count of the affected rows, not the resulting rows themselves. WithupdateManyAndReturnyou are now able to achieve this:This call to
updateManyAndReturnwill now return the actual records that have been updated in the query:Please note that like
createManyAndReturn,updateManyAndReturnis only supported in PostgreSQL, CockroachDB, and SQLite.Fixed runtime error in Node.js v23
While not officially supported, we understand that a lot of you like to be on the latest Node.js version — so we fixed an error that only occurred on Node.js 23. Happy coding ✌️
Prisma is hiring 🤝
Join us at Prisma to work on the most popular TypeScript ORM and other exciting products like the first serverless database built on unikernels!
We currently have two open roles in our Engineering team:
If these don’t fit, you can still check out our jobs page and send a general application.
v6.1.0Compare Source
Today we're releasing Prisma ORM version 6.1.0
In this version our
tracingPreview feature is being graduated to GA!Highlights
Tracing goes GA
The
tracingPreview feature is now stable. You now no longer have to includetracingin your set of enabled preview features.generator client { provider = "prisma-client-js" - previewFeatures = ["tracing"] }We have also changed some of the spans generated by Prisma Client. Previously, a trace would report the following spans:
Now, the following are reported:
Additionally, we have made a few changes to our dependencies:
@opentelemetry/apiis now a peer dependency instead of a regular dependencyregisterInstrumentationsin@opentelemetry/instrumentationis now re-exported by@prisma/instrumentationAfter upgrading to Prisma ORM 6.1.0 you will need to add
@opentelemetry/apito your dependencies if you haven't already:You will also no longer need to have
@opentelemetry/instrumentationif you only useregisterInstrumentations. In this case you can importregisterInstrumentationsfrom@prisma/instrumentationMutli-line comments in Prisma Schema Language (PSL)
Comments can now be defined as multi-line in your Prisma schema! Comments can use the existing format:
// this is a schema commentor can now also use our multi-line format:
Bug fixes
Tracing related
As we're moving our
tracingpreview to GA, a number of issues have been resolved. Here are a few highlights:suppressTracingOther issues
We also have a number of other issues that were resolved outside of our
tracingfeature.PrismaNeonHTTPadapterfindUniquereturnsnullwhen used instead ofPromise.allFixes and improvements
Prisma
TypeError: parentTracer.getSpanLimits is not a functionSpanconstructorprisma:enginespans do not respectsuppressTracing()tracing: enginespans don't pass throughSamplerprisma:client:operationprisma:enginespans are missing when there are multiplenew PrismaClient()invocationsparentTracer.getSpanLimits is not a functionopentelemetry-sdk-trace-base(e.g. Datadog tracer)traceparentcomments with multiple SQL statements@prisma/instrumentationdependencies peer dependenciesdb.statementattribute doesn't include thetraceparentcommentregisterInstrumentationsuses the global provider instead of the one passed inPrismaNeonHTTPadapter breaks on some types e.g. timestampPrisma failed to detect the libssl/openssl version to usePrisma Client
@prisma/instrumentationType Error:'InstrumentionNodeModuleDefintion' is not genericv6.0.1Compare Source
Today we are releasing the
6.0.1patch release to address an issue with using Prisma Client generated in a custom output path with Next.js.Changes
"type": "commonjs"addition in generatedpackage.jsonv6.0.0Compare Source
We’re excited to share the Prisma ORM v6 release today 🎉
As this is a major release, it includes a few breaking changes that may affect your application. Before upgrading, we recommend that you check out our upgrade guide to understand the impact on your application.
If you want to have an overview of what we accomplished since v5, check out our announcement blog post: Prisma 6: Better Performance, More Flexibility & Type-Safe SQL.
🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release.
Breaking changes
Minimum supported Node.js versions
The new minimum supported Node.js versions for Prisma ORM v6 are:
There is no official support for Node.js <18.18.0, 19, 21, 23.
Minimum supported TypeScript version
The new minimum supported TypeScript version for Prisma ORM v6 is: 5.1.0.
Schema change for implicit m-n relations on PostgreSQL
If you're using PostgreSQL and are defining implicit many-to-many relations in your Prisma schema, Prisma ORM maintains the relation table for you under the hood. This relation table has
AandBcolumns to represent the tables of the models that are part of this relation.Previous versions of Prisma ORM used to create a unique index on these two columns. In Prisma v6, this unique index is changing to a primary key in order to simplify for the default replica identity behaviour.
If you're defining implicit m-n relations in your Prisma schema, the next migration you'll create will contain
ALTER TABLEstatements for all the relation tables that belong to these relations.Full-text search on PostgreSQL
The
fullTextSearchPreview feature is promoted to General Availability only for MySQL. This means that if you're using PostgreSQL and currently make use of this Preview feature, you now need to use the newfullTextSearchPostgresPreview feature.Usage of
BufferPrisma v6 replaces the usage of
BufferwithUint8Arrayto represent fields of typeBytes. Make sure to replace all your occurrences of theBuffertype with the newUint8Array.Removed
NotFoundErrorIn Prisma v6, we removed the
NotFoundErrorin favor ofPrismaClientKnownRequestErrorwith error codeP2025infindUniqueOrThrow()andfindFirstOrThrow(). If you've relied on catchingNotFoundErrorinstances in your code, you need to adjust the code accordingly.New keywords that can't be used as model names:
async,await,usingWith this release, you can't use
async,awaitandusingas model names any more.Preview features promoted to General Availability
In this release, we are promoting a number of Preview features to General Availability.
fullTextIndexIf you use the full-text index feature in your app, you can now remove
fullTextIndexfrom thepreviewFeaturesin your Prisma schema:generator client { provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] }fullTextSearchIf you use the full-text search feature with MySQL in your app, you can now remove
fullTextSearchfrom thepreviewFeaturesin your Prisma schema:generator client { provider = "prisma-client-js" - previewFeatures = ["fullTextSearch"] }If you are using it with PostgreSQL, you need to update the name of the feature flag to
fullTextSearchPostgres:generator client { provider = "prisma-client-js" - previewFeatures = ["fullTextSearch"] + previewFeatures = ["fullTextSearchPostgres"] }New features
We are also releasing new features with this release:
prisma generate's outputCompany news
🚀 Prisma Postgres is free during Early Access
In case you missed it: We recently launched Prisma Postgres, a serverless database with zero cold starts, a generous free tier, connection pooling, real-time events, and a lot more! It’s entirely free during the Early Access phase, try it now!
✨ Let us know what you think of Prisma ORM
We're always trying to improve! If you've recently used Prisma ORM, we'd appreciate hearing your thoughts about your experience via this 2min survey.
Configuration
📅 Schedule: Branch creation - "before 8am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.