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 5 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
Release timeline
10653 releases since 2020One column per quarter.
Releases
- 3.12.0-dev.2728 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2624 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2524 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2424 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2324 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2224 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2123 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.2023 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1923 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1823 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1722 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1622 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1522 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1421 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1321 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1221 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1121 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.1021 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.918 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.818 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.716 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.616 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.516 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.416 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.316 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.216 Mar 2022pre-release
Nothing published for this version
- 3.12.0-dev.116 Mar 2022pre-release
Nothing published for this version
- 3.11.2-dev.124 Mar 2022pre-release
Nothing published for this version
- 3.11.124 Mar 2022
Release notes
Open source →Today, we are issuing the
3.11.1patch release.MongoDB (Preview)
Breaking: Filters no longer return
undefinedfields by defaultIn
3.11.1, we've changed what data is returned when filtering MongoDB documents onundefinedfields. The new rule is thatundefinedfields are excluded by default unless explicitly filtered for. This allows you to query for undefined and null values separately.Let's take a look at a concrete example. Given the following Prisma schema:
model Address { id Int @id @map("_id") city String street String? // Note that street is optional }For Mongo, optional fields can either be
nullorundefined(absent). The following documents are all valid for the schema above:{ "_id": 1, "city": "San Fransisco", "street": "Market st." } { "_id": 2, "city": "Seattle", "street": null } { "_id": 3, "city": "Chicago" }Prior to
3.11.1, if you queried forwhere: { street: null }, you'd get_id: 2and_id: 3. In3.11.1, you'll only get_id: 2. The ability to also query for the missing fields has also been added. For details, refer to the newisSetbelow to learn more.There are a few exceptions to this new default:
- A
havingfilter on an aggregated field will returnundefinedfields. This is because aggregation on undefined fields yieldsnull, notundefined, thus matching the filter. - Filters on undefined to-many relations (e.g., the backing array of a many-to-many is
undefined) will currently include those relations in the result set.
New
isSetfilter operationTo compensate for missing fields on documents no longer being returned by the filters above, we’ve added a new
isSet: boolfilter. This filter can be used to include fields that areundefinedon documents.Using the example above, to include the
undefinedfields, you can use anOR:await prisma.address.findMany({ where: { OR: [ { street: { isSet: false } }, { street: null } ] } })The
isSetoperation has been added to all scalar and embedded fields that are optional.New
unsetoperationIn
3.11.1, you can also remove a field with theunsetoperation.Using the example above, let's write a query to remove the street field:
await prisma.address.update({ where: { id: 10, }, data: { street: { unset: true, }, }, })This effectively sets the
streetfield toundefinedin the database.New
updateManyoperationWe now support updating embedded documents that match specific criteria.
For example, given the following schema:
model Product { id Int @id @map("_id") name String @unique photos Photo[] } type Photo { height Int @default(200) width Int @default(100) url String }Let's update the photo with a
urlof1.jpgto2.png:const product = prisma.product.update({ where: { id: 10, }, data: { photos: { updateMany: { where: { url: '1.jpg', }, data: { url: '2.png', }, }, }, }, })New
deleteManyoperationSimilar to
updateMany, you can also remove embeds that match specific criteria.Using the Prisma Schema above, let's delete all photos with a
heightof 100:const product = prisma.product.update({ where: { id: 10, }, data: { photos: { deleteMany: { where: { height: 100, }, }, }, }, }) - A
- 3.11.1-dev.324 Mar 2022pre-release
Nothing published for this version
- 3.11.1-dev.224 Mar 2022pre-release
Nothing published for this version
- 3.11.1-dev.124 Mar 2022pre-release
Nothing published for this version
- 3.11.015 Mar 2022
Release notes
Open source →Today, we are excited to share the
3.11.0stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements and new features
Experimental support for Embedded Document Filters
In the previous release, we added embedded document support for creates, updates, and deletes. In version
3.11.0, we’re adding the ability to filter embedded documents.Given the following schema:
datasource db { provider = "mongodb" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["mongoDb"] } model Product { id String @id @default(auto()) @map("_id") @db.ObjectId photos Photo[] } model Order { id String @id @default(auto()) @map("_id") @db.ObjectId shippingAddress Address billingAddress Address? } type Photo { height Int width Int url String } type Address { street String city String zip String }You can now filter within an embedded document:
// find all orders with the same shipping address const orders = await prisma.order.findMany({ where: { shippingAddress: { equals: { street: "555 Candy Cane Lane", city: "Wonderland", zip: "52337", }, }, }, })You can also filter on a "contains many" relationship:
// find all products that don't have photos const product = prisma.product.findMany({ where: { photos: { isEmpty: true } }, })This scratches the surface of what's possible. For a complete list of available operations, have a look at our documentation. Please share your feedback in this issue.
Ordering by embedded documents is in Preview
In addition to filtering, Prisma version
3.11.0now supports sorting by an embedded document.Using the example schema above, you can sort orders by their zip code:
// sort orders by zip code in ascending order const orders = await prisma.order.findMany({ orderBy: { shippingAddress: { zip: "asc", }, }, })Learn more about this feature in our documentation and don’t hesitate to reach out in this issue.
MongoDB query logging support
In this release, we’ve added the ability to log MongoDB queries. You can enable query logging in the
PrismaClientconstructor:const prisma = new PrismaClient({ log: [ { emit: 'event', level: 'query', }, ] }) prisma.$on('query', (e) => console.log(e.query))After enabling query logging, you'll start to see logs that resemble this in your console:
db.User.deleteMany({ _id: ( $in: [ “62261e0b18139c6099ba7097”, ], }, }) db.User.deleteMany({ _id: ( $in: [ “6226277a96069500743edcf9”, ], }, })The logs output by Prisma have the same format as the
mongoshconsole, so you can pipe the queries from your logs directly into your shell.MongoDB introspection update
We've updated the type inference behavior for MongoDB on introspection.
Prisma samples a field's data to select an appropriate type on introspection. In the past, Prisma picked the type used most often for fields with data with multiple types. However, this could cause problems when retrieving mixed data during runtime and throw exceptions, such as Prisma Studio or in Prisma Client queries.
From
3.11.0, Prisma defaults to theJsontype to all fields with mixed data types instead. Additionally, Prisma will still show a warning on the console and add a comment to the introspected Prisma schema so it is clear where such cases occur and that you can do something to fix them.Prisma Client logger revamp
In
3.11.0, we’ve rewritten our internal logger to reduce lock contention and enable future features like tracing. This is the first of many upcoming changes to improve the Prisma Client’s throughput, so if you were running into an upper limit on query performance, it’s time to update Prisma Client and give it a try!If you're running into query performance issues, please open an issue or connect with us on Slack.
CockroachDB now supports migrations (Preview)
We're excited to announce Preview support for migrations for CockroachDB. You can now evolve your Prisma schema and propagate the changes to your database using Prisma Migrate.
Give the feature a try and let us know what you think in this issue.
Detecting state of a diff with
migrate diffusing exit codePrisma version
3.11.0includes a new--exit-codeflag to themigrate diffcommand to detect the state of a diff in several ways.You can use the flag as follows:
npx prisma migrate diff --preview-feature \ --exit-code \ --from-[...] \ --to-[...]Here's a list of the default and changed behavior of the error codes:
## Default behavior of exit codes 0: Returned when the diff is empty or non-empty 1: Returned on error ## Changed behavior when --exit-code is used 0: Returned when the diff is empty 1: Returned on error 2: Returned when the diff is non-emptyRead about it in the reference documentation.
Fixes and improvements
Prisma
- Command to export SQL schema
- Waiting "too long" to input migration name leads to error message
db pushwith emptyschema.prisma:Error: TypeError: Cannot read properties of undefined (reading 'url')- migrate diff: --{from,to}-schema-datamodel should not error on missing env vars in datasource blocks
- migrate diff: Provide a reliable way to detect empty diffs / migrations
db executecannot resolve SQLite file path from schema- [MDB] Implement version and describe RPC calls for the error reporting backend
- [MDB] Create fields referenced in index definitions as Json to enable display of indexes in datamodel
- MongoDB many to many:
PANIC: called Option::unwrap() on a None
Prisma Client
- PANIC in query-engine/connectors/mongodb-query-connector/src/value.rs:185:24not yet implemented: (Json, Json("[]"))
- Prisma Mongo Panic called
Option::unwrap()on aNonevalue - Better error message for MongoDB replica sets
- MongoDB: Using
tlsCAFilefails - no such file or directory, open '/path/schema.prisma' since 3.1.1
- PANIC: called
Option::unwrap()on aNonevalue in query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs:301:74 containsstring filter not working with mongoDB- Referential integrity is not preserved when updating foreign key (in "prisma" mode)
- PANIC: called
Option::unwrap()on aNonevalue in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:112:74 - HasReject not evaluating correctly for per operation handlers
- Support MongoDB "query" logging
- CONTRIBUTING: document Prisma Client workflow of using local link
- MongoDB findRaw filter problem with ObjectId field.
- MongoDB: Better error message for when document does not match the defined schema
- Integrate orderBy for composite types
- Attempting to do a query in the Prisma Client on a model with a foreign key that has
@mappanics on 3.10.0 - Use embedded documents attributes in where clause
'then' in PrimsaPromisereturns false
Prisma Migrate
Language tools (e.g. VS Code)
- MongoDB M:N relations get referential actions auto completion suggestions, then does not validate
- Auto Completion:
mapdoes not exist for M:N in MongoDB - Autocomplete shows invalid suggestions for composite types
- Suggest auto() in VSCode autocomplete
- Clicking on a MongoDB composite type does not jump to definition
Prisma Engines
- Implement order by composites
- [Composites] Implement
equalsread operation - [Composites] Implement
isread operation - [Composites] Implement
isNotread operation - [Composites] Implement
isEmptyread operation - [Composites] Implement
everyread operation - [Composites] Implement
someread operation - [Composites] Implement
noneread operation
Credits
Huge thanks to @hayes, @maddhruv, @jasimon for helping!
📺 Join us for another "What's new in Prisma" livestream
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, March 17 at 5 pm Berlin | 8 am San Francisco.
- 3.11.0-integration-mobc-fix.19 Mar 2022pre-release
Nothing published for this version
- 3.11.0-integration-fix-empty-path.123 Feb 2022pre-release
Nothing published for this version
- 3.11.0-integration-chore-composite-list-filters.315 Mar 2022pre-release
Nothing published for this version
- 3.11.0-integration-chore-composite-list-filters.215 Mar 2022pre-release
Nothing published for this version
- 3.11.0-integration-chore-composite-list-filters.115 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.6215 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.6115 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.6014 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5914 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5814 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5714 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5614 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5514 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5414 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5314 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5213 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5112 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.5011 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4911 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4811 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4711 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4611 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4510 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4410 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4310 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.4210 Mar 2022pre-release
Nothing published for this version
- 3.11.0-dev.419 Mar 2022pre-release
Nothing published for this version