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 today
01 Sep 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
10657 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
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 excited to share the 2.15.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release.
In 2.11.0, we introduced support for native database types in the Prisma schema that allow you to map Prisma's scalar types to more specific types in the underlying database. However, these have not been compatible with the current Preview version of Prisma Migrate yet.
This release makes it possible to use Prisma Migrate with the native type annotations in your Prisma schema!
<details><summary>Expand for an example usage of Prisma Migrate with native types</summary>
Here's an example that uses several type annotations:
generator client {
provider = "prisma-client-js"
previewFeatures = ["nativeTypes"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement()) @db.Integer
published Boolean @default(false)
content String? @db.VarChar(1000)
title String @db.VarChar(191)
buffer Bytes?
}
Running a migration using the prisma migrate command, the following SQL is created:
CREATE TABLE "Post" (
"id" SERIAL,
"published" BOOLEAN NOT NULL DEFAULT false,
"content" VARCHAR(1000),
"title" VARCHAR(191) NOT NULL,
"buffer" BYTEA,
PRIMARY KEY ("id")
);
</details>
A common requirement, especially for local development, is the ability to quickly seed your database with initial data. This is now possible with Prisma using the new prisma db seed command which is introduced in Preview in this release. Seeding is currently supported via scripts written in TypeScript, JavaScript, Go and Shell.
The command expects a file called seed with the respective file extension inside your main prisma directory.
prisma/seed.jsprisma/seed.tsprisma/seed.goprisma/seed.sh<details><summary>Expand for an example seeding workflow using TypeScript</summary>
For example, this prisma/seed.ts file could be invoked using the new command:
// prisma/seed.ts
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
// A `main` function so that we can use async/await
async function main() {
const newUser = await prisma.user.create({
data: {
email: "[email protected]"
}
})
console.log(`new user created`, newUser.id)
}
main()
.catch((e) => {
console.error(e)
process.exit(1)
})
.finally(async () => {
await prisma.$disconnect()
})
To execute the seeding, run the new command with the --preview-feature flag:
prisma db seed --preview-feature
</details>
Please provide feedback for the new prisma db seed command here.
findFirst and findUnique queries if no record is foundWith the new rejectOnNotFound option, you can now tell Prisma Client to throw an exception when findFirst or findUnique does not find any records.
Here's an example:
const user = await client.user.findUnique({
where: {
id: 10,
},
rejectOnNotFound: true
})
// Throws "NotFoundError: No User found" if the
// user with id = 10 does not exist.
If you omit rejectOnNotFound, these calls continue to return undefined.
We've added some new capabilities to your where condition for filtering arrays in PostgreSQL:
has: a value is contained within the arrayhasEvery: all values are contained within the arrayhasSome: at least one values is contained in the arrayisEmpty: the array is emptyHere's an example:
model User {
id Int @id
roles Role[]
}
enum Role {
ADMIN
EDITOR
READER
}
const admin = await prisma.user.findFirst({
where: {
id: 1,
roles: {
has: 'ADMIN'
}
}
})
Learn more about this feature from this GitHub comment.
selectWhen using count queries, you can provide a number of options, e.g. for filtering. This release introduces the select option for count queries which lets you filter for non-null values of multiple fields in a single query.
Assume you have this User model with a number of optional fields:
model User {
id Int @id @default(autoincrement()) @db.Integer
createdAt DateTime @default(now())
name String?
email String?
birthday DateTime?
}
You can send the following query to retrieve the count of records that contain non-null values for the respective field:
const userCounts = await prisma.user.count({
select: {
name: true,
email: true,
birthday: true
}
})
This will return an object with the following structure, where the value of each field indicates how many records in the database contain a value for it:
{
name: 2,
email: 0,
birthday: 1
}
This is also works with aggregate and groupBy:
// new possibility:
const usersAggregation = await prisma.user.aggregate({
count: { name: true }
})
// same for group by:
const groupedByName = await prisma.user.aggregate({
by: ["name"],
count: true
})
// or more fine-grained control over the fields to be counted
const groupedByNameCount = await prisma.user.aggregate({
by: ["name"],
count: { name: true, _all: true }
})
In 2.11.0, we introduced the uncheckedScalarInputs preview flag which allowed you to modify relations by directly setting foreign keys in your queries (as opposed to using a nested write with the connect option).
Fire up that delete key because you can now remove this flag from your Prisma schema.
generator client {
provider = "prisma-client-js"
- previewFeatures = ["uncheckedScalarInputs"]
}
As a reminder, this allows you to set foreign keys directly:
// An example of the new API that directly sets the foreign key
const user = await prisma.profile.create({
data: {
bio: 'Hello World',
userId: 42
},
})
// If you prefer, you can still use the previous API via `connect`
const user = await prisma.profile.create({
data: {
bio: 'Hello World',
user: {
connect: { id: 42 }, // sets userId of Profile record
},
},
})
Read more about in the documentation on relation queries.
provider on your datasource block, for example when the migrations have been created with sqlite but the provider is now set to postgresql. Prisma Migrate will now print a helpful error message in these cases.prisma migrate reset can now be used in non-interactive environments (e.g. CI/CD) by passing the --force flag.prisma migrate reset is called to reset and repopulate the database in development. It's also triggered when the database is reset interactively after calling prisma migrate dev.As of this release, Prisma Studio can be used in dark mode! You can use the Settings icon in the top right corner to switch between light and dark mode.
We also included more powerful ways for you to filter the records of a table:
Json fieldsnativeTypes Preview featureThis version of introduces a few changes to the nativeTypes Preview feature:
Numeric alias for Decimal on PostgreSQL, MySQL and Microsoft SQL Server. Replace any Numeric types with Decimal when you upgrade.Serial, SmallSerial, and BigSerial aliases for INT AUTOINCREMENT, SMALLINT AUTOINCREMENT, and BIGINT AUTOINCREMENT on PostgreSQL. You can use Int @default(autoincrement()), Int @db.SmallInt @default(autoincrement()) or Int @db.BigInt @default(autoincrement()) when you upgrade.JSON to Json on MySQL.Datetime to DateTime on MySQL.FindOneModelArgs and FindManyModelArgs type definitions to improve consistency. See this issue for more details.findOne and moved many of the Typescript types under the Prisma namespace.Prisma Client Go now supports database transactions with a sparkly new Transaction API:
createUserA := client.User.CreateOne(
db.User.ID.Set("c"),
db.User.Email.Set("a"),
)
createUserB := client.User.CreateOne(
db.User.ID.Set("d"),
db.User.Email.Set("b"),
)
err := client.Prisma.Transaction(createUserA, createUserB).Exec(ctx)
if err != nil {
return err
}
Learn more about Transaction in the reference. If you'd like to try out Prisma Client Go, check out the Quickstart for a gentle introduction.
We now support secure connections between a Mac and SQL Server so your data is encrypted while in transit.
uncheckedScalarInputs@prisma/cli and @prisma/client have different versions in package.json$on('beforeExit')select & include (in Client requests) through typesprisma migrate reset in non-interactive environmentsprisma migrate reset fails if the db is not already initializedHuge thanks to @qsona, @mikebobadilla, @cyrus-za for helping!
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