Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.
Last release 6 days ago
27 Aug 2026
Ships fairly regularly
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
7 years old
10653 releases · first in 2020
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Today, we are issuing the 2.21.2 patch release.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Today, we are excited to share the 2.21.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release.
Whew, that's a tongue-twister for a neat feature.
Let's say you want to group your users by the city they live in and then order the results by the cities with the most users. In 2.21.0, now you can!
const userRatingsCount = await prisma.user.groupBy({
by: ['city'],
count: {
city: true,
},
orderBy: {
_count: {
city: 'desc',
},
},
})
<details> <summary>Click to view the underlying model</summary>
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
city String
}
</details>
The query returns the following:
[
{ city: 'Berlin', count: { city: 3 } },
{ city: 'Paris', count: { city: 2 } },
{ city: 'Amsterdam', count: { city: 1 } },
]
Enable this feature with the orderByAggregateGroup preview flag:
generator client {
provider = "prisma-client-js"
previewFeatures = ["orderByAggregateGroup"]
}
📚 Documentation: Order by aggregate group
Before 2.21.0, aggregations on nullable fields always returned 0, even when there was no record or if all aggregated records were nulls. Returning 0 for null values made it impossible to differentiate between these two different results.
We are changing aggregates to follow what the database returns:
For example, previously, if there's no record in the database or if all records are nulls, the following aggregation:
const result = await prisma.post.aggregate({
sum: { amount: true },
})
Results in:
{
sum: {
amount: 0
}
}
The result.sum type is currently of type { amount: number }.
Starting this release, the same query returns:
{
sum: {
amount: null
}
}
And result.sum is of type { amount: number | null }
📚 Documentation: Aggregates are nullable
disconnect no longer throws an error on unconnected recordsPrior to 2.21.0, if you ran the following code:
const user = await prisma.user.update({
where: { email: '[email protected]' },
data: {
profile: {
disconnect: true,
},
},
})
And no profile was connected to Bob, the client would throw with this error:
The records for relation `UserToProfile` between the `User` and `Profile` models are not connected.
We learned from you that handling this added unnecessary boilerplate to your applications. As of 2.21.0, we've removed this error. Now, if you try disconnecting an unconnected record, the operation does nothing and passes through.
This change is unlikely to affect you unless you explicitly handle the disconnect error. In that case, adjust your code because the command no longer throws an error.
📚 Documentation: $disconnect()
@default(dbgenerated("")) is no longer permittedThe dbgenerated() function allows you to define default values generated directly by the database and cannot yet be represented in the Prisma schema.
Previously, you could pass an empty string, i.e., @default(dbgenerated("")), which would fail since the contents are added into the migration SQL as columnName COLUMN_TYPE DEFAULT <contents of dbgenerated>
As of 2.21.0, if a value is present, it cannot be an empty string.
If you want an empty string default, the correct syntax is @default(dbgenerated("''") (or other quotation marks, depending on the database provider).
📚 Documentation: dbgenerated()
count throws an error if include is specified12.22.0DROP COLUMN ..., ADD COLUMN ... sequence of SQL statements. These silently drop the indexes present on the column, and migrate would only re-create them with the next migration. With this release, the issue has been fixed, and Migrate recreates the index in the same migration.This line is invalid. It does not start with any known Prisma schema keyword. in introspection for an invalid schema.db push crashes when used on specific Postgres connection string with non existing databaseWe worked on shipping some minor improvements and bug fixes:
Huge thanks to @Sytten, @endor, @iBluemind, @schiller-manuel, @mongolyy, @matthewmueller, @paularah, @Iamshankhadeep, @meeq, @safinsingh, @darioielardi for helping!
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.
The stream takes place on Youtube on Thursday, April 15 at 5pm Berlin | 8am San Francisco.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version