@prisma/client
7.10.1 · 15 Oct 2026Apache-2.024.6M / weekRepositoryHomepagenpmAtom feed
4.16.2 is the newest release of 4.x.
In short
74 new3 changed
Release note
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements
General improvements
In the last sprint, we focused our efforts on squashing as many bugs as we could. You can find the full list of improvements and bug fixes in the Fixes and improvements section below.
Some of the improvements we made include but are not limited to:
Improved optimistic concurrency control (GitHub issue)
Improved decimal precision
Improved handling of big amounts of prepared statement placeholders:
Databases impose limits when they hit a specific number, and when a query (either generated by Prisma Client or provided by the user directly as a raw query) hits it some users ran into a misleadingCan't reach database servererror message (GitHub issue). The error message will now be more useful (P2035error code), and Prisma Client should not cause these errors anymore.
If you notice any regression, please make sure to create a GitHub issue. We touched a lot of code in this sprint, and even though we are confident in our tests, something might have slipped through the cracks. We'd like to fix the regressions as soon as possible.
isolationLevel for sequential transaction operations
In version 4.2.0, we added support for setting transaction isolation levels for interactive transactions (Preview). You can now define isolation levels for sequential transaction operations: prisma.$transaction().
Isolation levels describe different types of trade-offs between isolation and performance that databases can make when processing transactions. Isolation levels determine what types of data leaking can occur between transactions or what data anomalies can occur.
To set the transaction isolation level, use the isolationLevel option in the second parameter of the API. For example:
await prisma.$transaction(
[
// sequential operations
prisma.user.create({ data: {/** args */ } }),
prisma.post.create({ data: {/** args */ } })
],
{
isolationLevel: Prisma.TransactionIsolationLevel.Serializable
}
)Prisma Client supports the following isolation levels if they're available in your database provider:
ReadCommittedReadUncommittedRepeatableReadSerializableSnapshot
Learn more about it in our documentation.
New P2034 error code for transaction conflicts or deadlocks
When using certain isolation levels, it is expected that a transaction can fail due to a write conflict or a deadlock, throwing an error. One way to solve these cases is by retrying the transaction.
To make this easier, we're introducing a new PrismaClientKnownRequestError with the error code P2034: "Transaction failed due to a write conflict or a deadlock. Please retry your transaction". You can programmatically catch the error and retry the transaction. Here's an example showing how you can retry a transaction:
import { Prisma, PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
async function main() {
const MAX_RETRIES = 5
let retries = 0;
let result;
while (retries < MAX_RETRIES) {
try {
result = await prisma.$transaction(
[
prisma.user.deleteMany({ where: { /** args */ } }),
prisma.post.createMany({ data: { /** args */ } })
],
{
isolationLevel: Prisma.TransactionIsolationLevel.Serializable
}
)
} catch (error) {
if (error.code === 'P2034') {
retries++
continue
}
throw error
}
}
}Fixes and improvements
Prisma Client
Wrong types for fluent API when used along with
rejectOnNotFoundWeird behavior with "in:" clause on a findMany() with orderBy + take
Error: P1001: Can't reach database server when including large table
Client shows contains filter on uuid data type despite not being a valid operation
A model with relation to another model via non-null foreign key has nullable type
Validation error when inserting data of type
List<String | DateTime>into field of typeList<String>Can't reach database server when doing a large findMany query
Maximum call stack size exceeded when creating huge amount of related rows
Unique constraint failed during
$transaction([deleteMany, createMany])MySQL: Optimistic Concurrency Control doesn't work with UpdateMany
Wrong type when retrieving multiple related records using fluent API
[PostgreSQL] Cannot create or update row with large Decimal value within
numericrangePrisma silently misses nested elements on MariaDB when it triggers a huge IN clause
createdAt @default(now())andupdatedAt @updatedAtget different times on row creationInteractive Transactions: fatal when throwing string instead of Error() since 3.10.0
Error: The provided database string is invalid. Unable to parse URL. in database URL.[mongoDB]
findRawdoes not work within aninteractiveTransactioninvalid character in $let in $lookup pipeline when using cursor and order by query
The findMany query fails silently when the array length passed through IN parameter exceeds 999
Given exponent overflowing the maximum accepted scale (255).: TryFromIntError(())
Calling
findUniqueconcurrently with aDateTimecolumn causes it to returnnullMaximum Call Stack Size Exceeded When Inserting large Array Object
This is a non-recoverable error: When creating Item with nested query
Given exponent overflowing the maximum accepted scale (255).: TryFromIntError(())
Tracing:
prisma:enginespans always get sampled when using probability based samplersonly one @updatedAt is filled by the QE although multiple are accepted in the schema
Insert fails if a table has a space in the name of the primary key
Upsert error on MySQL:
Query ... is required to return data, but found no record(s)Add tests for mongodb's
findRaw,aggregateRawandrunCommandRawin sequential transactions
Prisma
sqlite: show better error when a permission denied error occurs
Prisma v4 breaks support for empty
dbgenerated()- invalid migration created with no schema changeBinary engine:
$disconnectnever returns if engine failed to start
Prisma Migrate
Prisma Studio
We're hiring!
If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.
We're looking for a Developer Advocate (Frontend / Fullstack) and Back-end Engineer: Prisma Data Platform.
Feel free to read the job descriptions and apply using the links provided.
Prisma Data Platform
We're working on the Prisma Data Platform — a collaborative environment for connecting apps to databases. It includes the:
Data Browser for navigating, editing, and querying data
Data Proxy for your database's persistent, reliable, and scalable connection pooling.
Query Console for experimenting with queries
Try it out and let us know what you think!
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, September 29 at 5 pm Berlin | 8 am San Francisco.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.