Today, we are excited to share the 7.4.0 stable release 🎉
🌟 Star this repo for notifications about new releases, bug fixes & features — or follow us on X!
Highlights
ORM
Caching in Prisma Client
Today’s release is a big one, as we introduce a new caching layer into Prisma ORM. But why the need for a caching layer?
In Prisma 7, the query compiler runs as a WebAssembly module directly on the JavaScript main thread. While this simplified the architecture by eliminating the separate engine process, it introduced a trade-off: every query now synchronously blocks the event loop during compilation.
For individual queries, compilation takes between 0.1ms and 1ms, which is barely noticeable in isolation. But under high concurrency this overhead adds up and creates event loop contention that affects overall application throughput.
For instance, say we have a query that is run over and over, but is a similar shape:
// These two queries have the same shape:
const alice = await prisma.user.findUnique({ where: { email: 'alice@prisma.io' } })
const bob = await prisma.user.findUnique({ where: { email: 'bob@prisma.io' } })Prior to v7.4.0, this would be reevaluated ever time the query is run. Now, Prisma Client will extract the user-provided values and replaces them with typed placeholders, producing a normalized query shape:
prisma.user.findUnique({ where: { email: %1 } }) // cache key
↑
%1 = 'alice@prisma.io' (or 'bob@prisma.io')
This normalized shape is used as a cache key. On the first call, the query is compiled as usual and the resulting plan is stored in an LRU cache. On every subsequent call with the same query shape, regardless of the actual values, the cached plan is reused instantly without invoking the compiler.
We have more details on the impact of this change and some deep dives into Prisma architecture in an upcoming blog post!
Partial Indexes (Filtered Indexes) Support
We're excited to announce Partial Indexes support in Prisma! This powerful community-contributed feature allows you to create indexes that only include rows matching specific conditions, significantly reducing index size and improving query performance.
Partial indexes are available behind the partialIndexes preview feature for PostgreSQL, SQLite, SQL Server, and CockroachDB, with full migration and introspection support.
Basic usage
Enable the preview feature in your schema:
generator client {
provider = "prisma-client-js"
previewFeatures = ["partialIndexes"]
}Raw SQL syntax
For maximum flexibility, use the raw() function with database-specific predicates:
model User {
id Int @id
email String
status String
@@unique([email], where: raw("status = 'active'"))
@@index([email], where: raw("deletedAt IS NULL"))
}Type-safe object syntax
For better type safety, use the object literal syntax for simple conditions:
model Post {
id Int @id
title String
published Boolean
@@index([title], where: { published: true })
@@unique([title], where: { published: { not: false } })
}Bug Fixes
Most of these fixes are community contributions - thank you to our amazing contributors!
- prisma/prisma-engines#5767: Fixed an issue with PostgreSQL migration scripts that prevented usage of
CREATE INDEX CONCURRENTLYin migrations - prisma/prisma-engines#5752: Fixed BigInt precision loss in JSON aggregation for MySQL and CockroachDB by casting BigInt values to text (from community member polaz)
- prisma/prisma-engines#5750: Fixed connection failures with non-ASCII database names by properly URL-decoding database names in connection strings
- #29155: Fixed silent transaction commit errors in PlanetScale adapter by ensuring COMMIT failures are properly propagated
- #29141: Resolved race condition errors (EREQINPROG) in SQL Server adapter by serializing commit/rollback operations using mutex synchronization
- #29158: Fixed MSSQL connection string parsing to properly handle curly brace escaping for passwords containing special characters
Open roles at Prisma
Interested in joining Prisma? We’re growing and have several exciting opportunities across the company for developers who are passionate about building with Prisma. Explore our open positions on our Careers page and find the role that’s right for you.
Enterprise support
Thousands of teams use Prisma and many of them already tap into our Enterprise & Agency Support Program for hands-on help with everything from schema integrations and performance tuning to security and compliance.
With this program you also get priority issue triage and bug fixes, expert scalability advice, and custom training so that your Prisma-powered apps stay rock-solid at any scale. Learn more or join: https://prisma.io/enterprise.