Prisma: 6.0.0 Release

Release date:
November 28, 2024
Previous version:
5.22.0 (released November 5, 2024)
Magnitude:
4,678 Diff Delta
Contributors:
14 total committers
Data confidence:
Commits:

185 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored November 11, 2024
Authored November 12, 2024
Authored November 8, 2024
Authored November 12, 2024
Authored November 12, 2024
Authored November 12, 2024
Authored November 27, 2024
Authored November 12, 2024
Authored November 13, 2024
Authored November 26, 2024
Authored November 26, 2024
Authored November 8, 2024
Authored November 14, 2024
Authored November 9, 2024

Top Contributors in 6.0.0

aqrln
jkomyno
jacek-prisma
SevInf
LucianBuzzo
prisma-bot
andyjy
pasha-vuiko
Mayureshd-18
samirotiv

Directory Browser for 6.0.0

All files are compared to previous version, 5.22.0. Click here to browse diffs between other versions.

Loading File Browser...

Release Notes Published

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

āš ļøĀ This section contains a list of breaking changes. If you upgrade your application to Prisma ORM v6 without addressing these, your application is going to break! For detailed upgrade instructions, check out the upgrade guide. āš ļøĀ 

Minimum supported Node.js versions

The new minimum supported Node.js versions for Prisma ORM v6 are:

  • for Node.js 18 the minimum supported version is 18.18.0
  • for Node.js 20 the minimum supported version is 20.9.0
  • for Node.js 22 the minimum supported version is 22.11.0

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Ā AĀ andĀ BĀ columns 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 TABLEĀ statements forĀ allĀ the relation tablesĀ that belong to these relations.

Full-text search on PostgreSQL

The fullTextSearch Preview 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 new fullTextSearchPostgres Preview feature.

Usage ofĀ Buffer

Prisma v6 replaces the usage of Buffer with Uint8Array to represent fields of type Bytes. Make sure to replace all your occurrences of the Buffer type with the new Uint8Array.

RemovedĀ NotFoundError

In Prisma v6, we removed theĀ NotFoundErrorĀ in favor ofĀ PrismaClientKnownRequestErrorĀ with error codeĀ P2025Ā inĀ findUniqueOrThrow()Ā andĀ findFirstOrThrow(). If you've relied on catchingĀ NotFoundErrorĀ instances in your code, you need to adjust the code accordingly.

New keywords that can't be used as model names: async, await, using

With this release, you can't use async, await and using as model names any more.


āš ļøĀ For detailed upgrade instructions, check out the upgrade guide. āš ļøĀ 

Preview features promoted to General Availability

In this release, we are promoting a number ofĀ PreviewĀ features toĀ General Availability.

fullTextIndex

If you use theĀ full-text indexĀ feature in your app, you can now removeĀ fullTextIndexĀ from theĀ previewFeaturesĀ in your Prisma schema:

generator client {
  provider        = "prisma-client-js"
- previewFeatures = ["fullTextIndex"]
}

fullTextSearch

If you use theĀ full-text searchĀ feature withĀ MySQLĀ in your app, you can now removeĀ fullTextSearchĀ from theĀ previewFeaturesĀ in 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:

Company 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.