Update prisma monorepo to v6 (major)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @prisma/client (source) | 3.15.2 -> 6.3.1 |
||||
| prisma (source) | 3.15.2 -> 6.3.1 |
Release Notes
prisma/prisma (@prisma/client)
v6.3.1
This patch releases introduces improvements to the prisma init output when invoked to with the --db option.
Run npx prisma@latest init --db to get an instant Prisma Postgres database.
v6.3.0
Today, we are excited to share the 6.3.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release. 🌟
Highlights
A brand new Prisma Studio
In this release we've included several great improvements to Prisma Studio's developer experience. You can learn all about the changes we've made in our release blog post, but here's a short list:
Prisma Studio is back in the Console
Fans of Prisma Data Browser rejoice! The new Prisma Studio is now in the Prisma Console and is available for all PostgreSQL and MySQL databases.
A new model viewer
Previously, switching from model to model in Prisma Studio would require backing all the way out to the model view, then digging in again. With our new UI, it's easy to switch from model to model while keeping your place.
A new editing experience
If you're trying to edit a given field in a model, Prisma Studio made it quite easy. However, if you're trying to edit every field in a given row, it could get quite annoying to keep scrolling left to right. Our new edit sidebar resolves that with the ability to edit all fields for a given row at once.
Clean up at the click of a button
When editing a number of models, it can get difficult to get back to a clean slate. In the new Prisma Studio, we've added a "Close all" button that puts you back to a fresh start.
Add limit to updateMany() and deleteMany()
Previously, limit has not existed as a valid option in top level updateMany() and deleteMany() queries. In 6.3.0 limit is now available in these queries, bringing their features more in line with other query types.
You can use limit like the following:
await prisma.user.deleteMany({
where: { column: 'value' },
limit: 100,
});
This will limit the number of deleted users to 100 at maximum.
Sort generator fields deterministically
In previous version of Prisma ORM, the fields inside of a generator block in your Prisma Schema were not deterministically sorted. This could lead to cases where prisma db pull could lead to re-ordering of fields.
In 6.3.0, the sorting of fields in this block is now deterministic. You may see re-ordering on the first prisma db pull after you upgrade, but it will remain consistent afterwards.
Replace NOT IN with NOT EXISTS for PostgreSQL relation filters
In previous versions of Prisma ORM, when using the none or some relation filters, the SQL queries generated used NOT IN. In many cases this lead to performance issues as the size of the related table grew. In 6.3.0, we’ve replaced these usages of IN with EXISTS in order to improve query performance.
A special thank you
We'd like to extend our heartfelt thanks to @loren and his team for the collaboration and trust in our enterprise support plan. Working closely with them allowed us to address important issues like #19249 and #17303. Their insights and partnership have been invaluable in improving our product.
If your team could benefit from dedicated support and tailored solutions, learn more about our enterprise support plan.
Fixes and improvements
Prisma Client
Prisma
- Prisma interactive transaction ignores DB exception on commit (with triggers)
prisma db pullnon-deterministically sorts generator fieldsno entry found for keyerror on views<->model relations- Adding
onUpdatedata to the DMMF in@prisma/generator-helper
Credits
Huge thanks to @WhyAsh5114 for their contributions to this release!
v6.2.1
Today we are releasing the 6.2.1 patch release to address an issue with some of the omitApi preview feature checks having been accidentally omitted when making the feature GA. Now it is fully functional without the preview feature flag.
Changes
v6.2.0
Today we're releasing Prisma ORM version 6.2.0 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
We have a number of new features in this version, including support for json and enum fields in SQLite, a new updateManyAndReturn function, support for ULID values, as well as the promotion of the omit feature from Preview to Generally Availability.
Highlights
Excluding fields via omit is now production-ready
Our number one requested feature is out of Preview and Generally Available. In 6.2.0, you no longer need to add omitApi to your list of Preview features:
generator client {
provider = "prisma-client-js"
- previewFeatures = ["omitApi"]
}
As a refresher: omit allows you to exclude certain fields from being returned in the results of your Prisma Client queries.
You can either do this locally, on a per-query level:
const result = await prisma.user.findMany({
omit: {
password: true,
},
});
Or globally, to ensure a field is excluded from all queries of a certain model:
const prisma = new PrismaClient({
omit: {
user: {
password: true
}
}
})
// The password field is excluded in all queries, including this one
const user = await prisma.user.findUnique({ where: { id: 1 } })
For more information on omit, be sure to check our documentation.
json and enum fields in SQLite
Previous to this version, you could not define json and enum fields in your Prisma schema when using SQLite. The respective GitHub issues have been among the most popular ones in our repo, so with our new approach to open-source governance, we finally got to work and implemented these.
Working with JSON and Enum fields works similarly to other database providers, here’s an example:
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
model User {
id Int @​id @​default(autoincrement())
name String
role Role
data Json
}
enum Role {
Customer
Admin
}
Support for auto-generated ULID values
Similar to cuid2 support released in ORM version 6.0.0, we are now adding support for Universally Unique Lexicographically Sortable Identifiers (or short: ULIDs 😄) in version 6.2.0. A ULID value is a 26-character alphanumeric string, e.g. 01GZ0GZ3XARH8ZP44A7TQ2W4ZD.
With this new feature, you can now create records with auto-generated ULID values for String fields:
model User {
id String @​id @​default(ulid())
}
New batch function: updateManyAndReturn
updateMany allows you to update many records in your database, but it only returns the count of the affected rows, not the resulting rows themselves. With updateManyAndReturn you are now able to achieve this:
const users = await prisma.user.updateManyAndReturn({
where: {
email: {
contains: 'prisma.io',
}
},
data: {
role: 'ADMIN'
}
})
This call to updateManyAndReturn will now return the actual records that have been updated in the query:
[{
id: 22,
name: 'Alice',
email: '[email protected]',
profileViews: 0,
role: 'ADMIN',
coinflips: []
}, {
id: 23,
name: 'Bob',
email: '[email protected]',
profileViews: 0,
role: 'ADMIN',
coinflips: []
}]
Please note that like createManyAndReturn, updateManyAndReturn is only supported in PostgreSQL, CockroachDB, and SQLite.
Fixed runtime error in Node.js v23
While not officially supported, we understand that a lot of you like to be on the latest Node.js version — so we fixed an error that only occurred on Node.js 23. Happy coding ✌️
Prisma is hiring 🤝
Join us at Prisma to work on the most popular TypeScript ORM and other exciting products like the first serverless database built on unikernels!
We currently have two open roles in our Engineering team:
If these don’t fit, you can still check out our jobs page and send a general application.
v6.1.0
Today we're releasing Prisma ORM version 6.1.0
In this version our tracing Preview feature is being graduated to GA!
Highlights
Tracing goes GA
The tracing Preview feature is now stable. You now no longer have to include tracing in your set of enabled preview features.
generator client {
provider = "prisma-client-js"
- previewFeatures = ["tracing"]
}
We have also changed some of the spans generated by Prisma Client. Previously, a trace would report the following spans:
prisma:client:operation
prisma:client:serialize
prisma:engine
prisma:engine:connection
prisma:engine:db_query
prisma:engine:serialize
Now, the following are reported:
prisma:client:operation
prisma:client:serialize
prisma:engine:query
prisma:engine:connection
prisma:engine:db_query
prisma:engine:serialize
prisma:engine:response_json_serialization
Additionally, we have made a few changes to our dependencies:
@opentelemetry/apiis now a peer dependency instead of a regular dependencyregisterInstrumentationsin@opentelemetry/instrumentationis now re-exported by@prisma/instrumentation
After upgrading to Prisma ORM 6.1.0 you will need to add @opentelemetry/api to your dependencies if you haven't already:
npm install @​opentelemetry/api
You will also no longer need to have @opentelemetry/instrumentation if you only use registerInstrumentations. In this case you can import registerInstrumentations from @prisma/instrumentation
- import { PrismaInstrumentation } from '@​prisma/instrumentation'
+ import { PrismaInstrumentation, registerInstrumentations } from '@​prisma/instrumentation'
Bug fixes
Tracing related
As we're moving our tracing preview to GA, a number of issues have been resolved. Here are a few highlights:
- Tests for tracing expanded and improved
- Issues with Elastic APM addressed
- Issues with Datadog tracer addressed
- Prisma Client now respects
suppressTracing
Other issues
We also have a number of other issues that were resolved outside of our tracing feature.
- Resolved type issues with the
PrismaNeonHTTPadapter findUniquereturnsnullwhen used instead ofPromise.all- Resolved an issue with the latest version of Alpine Linux
Fixes and improvements
Prisma
- Tracing: Detailed report and profiling informations
- Prisma Client Request Tracing Integration
- Instrumentation error in production:
TypeError: parentTracer.getSpanLimits is not a function - Prisma is using the internal
Spanconstructor - Prisma Client doesn't put all OTEL trace spans under one parent span
- Prisma trace has unaccounted time
prisma:enginespans do not respectsuppressTracing()tracing: enginespans don't pass throughSampler- Add tests for tracing and different ways to open the first connection (including internal spans)
- Tracing: Long trailing delay in
prisma:client:operation prisma:enginespans are missing when there are multiplenew PrismaClient()invocationsparentTracer.getSpanLimits is not a function- Support tracers not derived from
opentelemetry-sdk-trace-base(e.g. Datadog tracer) traceparentcomments with multiple SQL statements- Make
@prisma/instrumentationdependencies peer dependencies - Make sure
db.statementattribute doesn't include thetraceparentcomment - [Instrumentation]
registerInstrumentationsuses the global provider instead of the one passed in - Instrumentation: Problems in working with Elastic APM
PrismaNeonHTTPadapter breaks on some types e.g. timestamp- Promise.all() returns null with findUnique()
- Alpine Linux 3.21:
Prisma failed to detect the libssl/openssl version to use
Prisma Client
- Tracing operation duration bug under stress test
@prisma/instrumentationType Error:'InstrumentionNodeModuleDefintion' is not generic
v6.0.1
v6.0.0
We’re excited to share the Prisma ORM v6 release today 🎉
As this is a major release, it includes a few breaking changes that may affect your application. Before upgrading, we recommend that you check out our upgrade guide to understand the impact on your application.
If you want to have an overview of what we accomplished since v5, check out our announcement blog post: Prisma 6: Better Performance, More Flexibility & Type-Safe SQL.
🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release.
Breaking changes
⚠️ This section contains a list of breaking changes. If you upgrade your application to Prisma ORM v6 without addressing these, your application is going to break! For detailed upgrade instructions, check out the upgrade guide. ⚠️
Minimum supported Node.js versions
The new minimum supported Node.js versions for Prisma ORM v6 are:
- for Node.js 18 the minimum supported version is 18.18.0
- for Node.js 20 the minimum supported version is 20.9.0
- for Node.js 22 the minimum supported version is 22.11.0
There is no official support for Node.js <18.18.0, 19, 21, 23.
Minimum supported TypeScript version
The new minimum supported TypeScript version for Prisma ORM v6 is: 5.1.0.
Schema change for implicit m-n relations on PostgreSQL
If you're using PostgreSQL and are defining implicit many-to-many relations in your Prisma schema, Prisma ORM maintains the relation table for you under the hood. This relation table has A and B columns to represent the tables of the models that are part of this relation.
Previous versions of Prisma ORM used to create a unique index on these two columns. In Prisma v6, this unique index is changing to a primary key in order to simplify for the default replica identity behaviour.
If you're defining implicit m-n relations in your Prisma schema, the next migration you'll create will contain ALTER TABLE statements for all the relation tables that belong to these relations.
Full-text search on PostgreSQL
The fullTextSearch Preview feature is promoted to General Availability only for MySQL. This means that if you're using PostgreSQL and currently make use of this Preview feature, you now need to use the new fullTextSearchPostgres Preview feature.
Usage of Buffer
Prisma v6 replaces the usage of Buffer with Uint8Array to represent fields of type Bytes. Make sure to replace all your occurrences of the Buffer type with the new Uint8Array.
Removed NotFoundError
In Prisma v6, we removed the NotFoundError in favor of PrismaClientKnownRequestError with error code P2025 in findUniqueOrThrow() and findFirstOrThrow(). If you've relied on catching NotFoundError instances in your code, you need to adjust the code accordingly.
New keywords that can't be used as model names: async, await, using
With this release, you can't use async, await and using as model names any more.
⚠️ For detailed upgrade instructions, check out the upgrade guide. ⚠️
Preview features promoted to General Availability
In this release, we are promoting a number of Preview features to General Availability.
fullTextIndex
If you use the full-text index feature in your app, you can now remove fullTextIndex from the previewFeatures in your Prisma schema:
generator client {
provider = "prisma-client-js"
- previewFeatures = ["fullTextIndex"]
}
fullTextSearch
If you use the full-text search feature with MySQL in your app, you can now remove fullTextSearch from the previewFeatures in your Prisma schema:
generator client {
provider = "prisma-client-js"
- previewFeatures = ["fullTextSearch"]
}
If you are using it with PostgreSQL, you need to update the name of the feature flag to fullTextSearchPostgres:
generator client {
provider = "prisma-client-js"
- previewFeatures = ["fullTextSearch"]
+ previewFeatures = ["fullTextSearchPostgres"]
}
New features
We are also releasing new features with this release:
- cuid2() support
- Include unused enum definitions in
prisma generate's output - Improved compatibility with Deno 2
Company news
🚀 Prisma Postgres is free during Early Access
In case you missed it: We recently launched Prisma Postgres, a serverless database with zero cold starts, a generous free tier, connection pooling, real-time events, and a lot more! It’s entirely free during the Early Access phase, try it now!
✨ Let us know what you think of Prisma ORM
We're always trying to improve! If you've recently used Prisma ORM, we'd appreciate hearing your thoughts about your experience via this 2min survey.
v5.22.0
Today, we are excited to share the 5.22.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release.
Highlights
Further Tracing Improvements
In our ongoing effort to stabilize the tracing Preview feature, we’ve made our spans compliant with OpenTelemetry Semantic Conventions for Database Client Calls. This should lead to better compatibility with tools such as DataDog and Sentry.
We’ve also included numerous bug fixes that should make this Preview feature easier to work with.
Metrics bug fix
Occasionally, connection pool metrics would become negative or grow unbounded. In this release, connection pool metrics should stay consistent.
Connection Pool Timeout fix
In a specific case, there could be issues where fetching a new connection from the connection pool would time out, regardless of the state of the application and connection pool. If you have experience connection pool issues accessing a PostgreSQL database with TLS encryption in a resource-constrained environment (such as Function-as-a-Service offerings or very small VPS) this should resolve those issues.
Special thanks to @youxq for their pull request and help resolving this issue!
Join us
Looking to make an impact on Prisma in a big way? We're hiring!
Learn more on our careers page: https://www.prisma.io/careers
Fixes and improvements
Prisma Migrate
Prisma
- Prisma generate randomly fails on Ubuntu due to missing internal .so
libquery_engine-debian-openssl-1.1.x.so.node - Timed out fetching a new connection from the connection pool.
- Some
prisma:engine:connectionspans have no parent - Query-related spans outside of
prisma:engine:itx_runnerare disconnected from the tree - Tracing with dataproxy/mini-proxy:
itx_runnerspan and it's children are missing sometimes - Incorrect OpenTelemetry span reported by Prisma
- OTEL spans are not recognised as spans from a database
- SQL Injection bug - D1 adaptor throws "Conversion failed: expected a datetime string in column" when string column contains any ISO date
- Prisma generate randomly fails on Ubuntu due to missing internal .so
libquery_engine-debian-openssl-1.1.x.so.node
Credits
Huge thanks to @tmm1, @Takur0, @hinaloe, @andyjy, and @youxq for helping!
v5.21.1
- Fixed a bug where migrations were not using shadow database correctly in some edge cases
v5.21.0
Today, we are excited to share the 5.21.0 release 🎉
🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release.
Highlights
Better support for tracing in MongoDB
The tracing Preview feature now has full support for MongoDB with previously missing functionality now implemented. This is a part of the ongoing effort to stabilize this Preview feature and release it in General Availability.
tracing is a Preview feature that enables built-in support for OpenTelemetry instrumentation inside the Prisma Client and provides deep insights into the performance and timing of your queries. See our documentation for more information.
For an easy to use and zero-configuration tracing instrumentation tool with a dashboard that provides an overview of your queries, statistics, and AI-powered recommendations, try Prisma Optimize.
WebAssembly engine size decrease for edge functions
Due to recent changes, some users experienced a steep increase of the bundle size in Prisma 5.20 when using the driverAdapters Preview feature, going over the 1 MB limit on the free tier of Cloudflare Workers. This has now been fixed.
Fixes and improvements
Prisma Engines
Credits
Huge thanks to @austin-tildei, @LucianBuzzo, @mcuelenaere, @pagewang0, @key-moon, @pranayat, @yubrot, @skyzh for helping!
v5.20.0
🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release. 🌟
Highlights
strictUndefinedChecks in Preview
With Prisma ORM 5.20.0, the Preview feature strictUndefinedChecks will disallow any value that is explicitly undefined and will be a runtime error. This change is direct feedback from this GitHub issue and follows our latest proposal on the same issue.
To demonstrate the change, take the following code snippet:
prisma.table.deleteMany({
where: {
// If `nullableThing` is nullish, this query will remove all data.
email: nullableThing?.property,
}
})
In Prisma ORM 5.19.0 and below, this could result in unintended behavior. In Prisma ORM 5.20.0, if the strictUndefinedChecks Preview feature is enabled, you will get a runtime error instead:
Invalid \`prisma.user.findMany()\` invocation in
/client/tests/functional/strictUndefinedChecks/test.ts:0:0
XX })
XX
XX test('throws on undefined input field', async () => {
→ XX const result = prisma.user.deleteMany({
where: {
email: undefined
~~~~~~~~~
}
})
Invalid value for argument \`where\`: explicitly \`undefined\` values are not allowed."
We have also introduced the Prisma.skip symbol, which will allow you to get the previous behavior if desired.
prisma.table.findMany({
where: {
// Use Prisma.skip to skip parts of the query
email: nullableEmail ?? Prisma.skip
}
})
From Prisma ORM 5.20.0 onward, we recommend enabling strictUndefinedChecks, along with the TypeScript compiler option exactOptionalPropertyTypes, which will help catch cases of undefined values at compile time. Together, these two changes will help protect your Prisma queries from potentially destructive behavior.
strictUndefinedChecks will be a valid Preview feature for the remainder of Prisma ORM 5. With our next major version, this behavior will become the default and the Preview feature will be “graduated” to Generally Available.
If you have any questions or feedback about strictUndefinedChecks, please ask/comment in our dedicated Preview feature GitHub discussion.
typedSql bug fix
Thank you to everyone who has tried out our typedSql Preview feature and provided feedback! This release has a quick fix for typescript files generated when Prisma Schema enums had hyphens.
Fixes and improvements
Prisma
- Prisma incorrectly parses CRDB's FK constraint error as
not available. - Invalid TypeScript files created by
generatewhen typedSql is enabled and enum contains hyphens. @prisma/internalsdidn't listts-toolbeltin dependencies.- using
$extendsprevents model comments from being passed to TypeScript
Prisma Engines
Credits
Huge thanks to @mcuelenaere, @pagewang0, @key-moon, @pranayat, @yubrot, @thijmenjk, @mydea, @HRM, @haaawk, @baileywickham, @brian-dlee, @nickcarnival, @eruditmorina, @nzakas, and @gutyerrez for helping!
v5.19.1
Today, we are issuing the 5.19.1 patch release.
What's Changed
We've fixed the following issues:
- https://github.com/prisma/prisma/issues/25103
- https://github.com/prisma/prisma/issues/25137
- https://github.com/prisma/prisma/issues/25104
- https://github.com/prisma/prisma/issues/25101
Full Changelog: https://github.com/prisma/prisma/compare/5.19.0...5.19.x, https://github.com/prisma/prisma-engines/compare/5.19.0...5.19.x
v5.19.0
Today, we are excited to share the 5.19.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release. 🌟
Highlights
Introducing TypedSQL
TypedSQL is a brand new way to interact with your database from Prisma Client. After enabling the typedSql Preview feature, you’re able to write SQL queries in a new sql subdirectory of your prisma directory. These queries are then checked by Prisma during using the new --sql flag of prisma generate and added to your client for use in your code.
To get started with TypedSQL:
-
Make sure that you have the latest version of
prismaand@prisma/clientinstalled:npm install -D prisma@latest npm install @​prisma/client@latest -
Enable the
typedSqlPreview feature in your Prisma Schema.generator client { provider = "prisma-client-js" previewFeatures = ["typedSql"] } -
Create a
sqlsubdirectory of yourprismadirectory.mkdir -p prisma/sql -
You can now add
.sqlfiles to thesqldirectory! Each file can contain one sql query and the name must be a valid JS identifier. For this example, say you had the filegetUsersWithPosts.sqlwith the following contents:SELECT u.id, u.name, COUNT(p.id) as "postCount" FROM "User" u LEFT JOIN "Post" p ON u.id = p."authorId" GROUP BY u.id, u.name -
Import your SQL query into your code with the
@prisma/client/sqlimport:import { PrismaClient } from '@​prisma/client' import { getUsersWithPosts } from '@​prisma/client/sql' const prisma = new PrismaClient() const usersWithPostCounts = await prisma.$queryRawTyped(getUsersWithPosts) console.log(usersWithPostCounts)
There’s a lot more to talk about with TypedSQL. We think that the combination of the high-level Prisma Client API and the low-level TypedSQL will make for a great developer experience for all of our users.
To learn more about behind the “why” of TypedSQL be sure to check out our announcement blog post.
For docs, check out our new TypedSQL section.
Bug fixes
Driver adapters and D1
A few issues with our driverAdapters Preview feature and Cloudflare D1 support were resolved via https://github.com/prisma/prisma-engines/pull/4970 and https://github.com/prisma/prisma/pull/24922
- Mathematic operations such as
max,min,eq, etc in queries when using Cloudflare D1. - Resolved issues when comparing
BigIntIDs whenrelationMode="prisma"was enabled and Cloudflare D1 was being used.
Joins
- https://github.com/prisma/prisma/issues/23742 fixes Prisma Client not supporting deeply nested
someclauses when therelationJoinsPreview feature was enabled.
Join us
Looking to make an impact on Prisma in a big way? We're now hiring engineers for the ORM team!
- Senior Engineer (TypeScript): This person will be primarily working on the TypeScript side and evolving our Prisma client. Rust knowledge (or desire to learn Rust) is a plus.
- Senior Engineer (Rust): This person will be focused on the
prisma-enginesRust codebase. TypeScript knowledge (or, again, a desire to learn) is a plus.
Credits
Huge thanks to @mcuelenaere, @pagewang0, @Druue, @key-moon, @Jolg42, @pranayat, @ospfranco, @yubrot, @skyzh for helping!
v5.18.0
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Native support for UUIDv7
Previous to this release, the Prisma Schema function uuid() did not accept any arguments and created a UUIDv4 ID. While sufficient in many cases, UUIDv4 has a few drawbacks, namely that it is not temporally sortable.
UUIDv7 attempts to resolve this issue, making it easy to temporally sort your database rows by ID!
To support this, we’ve updated the uuid() function in Prisma Schema to accept an optional, integer argument. Right now, the only valid values are 4 and 7, with 4 being the default.
model User {
id String @​id @​default(uuid()) // defaults to 4
name String
}
model User {
id String @​id @​default(uuid(4)) // same as above, but explicit
name String
}
model User {
id String @​id @​default(uuid(7)) // will use UUIDv7 instead of UUIDv4
name String
}
Bug squashing
We’ve squashed a number of bugs this release, special thanks to everyone who helped us! A few select highlights are:
- SQLite db will now be created and read from the correct location when using
prismaSchemaFolder. - Empty
Json[]fields will now return[]instead ofnullwhen accessed through a join using therelationJoinsPreview feature.
Fixes and improvements
Prisma
Language tools (e.g. VS Code)
Credits
Huge thanks to @mcuelenaere, @pagewang0, @Druue, @key-moon, @Jolg42, @pranayat, @ospfranco, @yubrot, @skyzh, @haaawk for helping!
v5.17.0
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
VSCode extension improvements
We’re happy to introduce some cool new features that will make your experience with the Prisma VSCode extension even better!
Find references across schema files
The ability to hop between references of a given symbol is really useful in application code and now with the introduction of multi-file schema, we think it’s the perfect time to bring this feature to the VSCode extension!
With the 5.17.0 release, you’ll now have the ability to use the native “find references” feature to find any usage of a given symbol
Added context on hover
When hovering over a symbol that references a view, type, enum, or any other block with multiple values, you’ll now see a handy pop out that shows what is in that block at a glance.
Additional quick fixes
We’ve taken some fixes made by the prisma format cli command and made them quick fixes available to the VSCode Extension. Now, when you have forget a back relation or relation scalar field, you’ll now see in real time what is wrong and have the option to fix it via the extension.
QueryRaw performance improvements
We’ve changed the response format of queryRaw to decrease its average size which reduces serialization CPU overhead.
When querying large data sets, we expect you to see improved memory usage and up to 2x performance improvements.
Fixes and improvements
Prisma Client
Prisma
Language tools (e.g. VS Code)
Credits
Huge thanks to @key-moon, @pranayat, @yubrot, @skyzh for helping!
v5.16.2
Today, we are issuing the 5.16.2 patch release to fix an issue in Prisma client.
Fix in Prisma Client
v5.16.1
Today, we are issuing the 5.16.1 patch release to fix an issue in Prisma client.
Fix in Prisma Client
- dotenv loading issue with PrismaClient
- Prisma Seed Script Fails After Upgrading to v5.16.0 (DATABASE_URL Error)
v5.16.0
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Omit model fields globally
With Prisma ORM 5.16.0 we’re more than happy to announce that we’re expanding the omitApi Preview feature to also include the ability to omit fields globally.
When the Preview feature is enabled, you’re able to define fields to omit when instantiating Prisma Client.
const prisma = new PrismaClient({
omit: {
user: {
// make sure that password is never queried.
password: true,
},
},
});
You’re also able to omit fields from multiple models and multiple fields from the same model
const prisma = new PrismaClient({
omit: {
user: {
// make sure that password and internalId are never queried.
password: true,
internalId: true,
},
post: {
secretkey: true,
},
},
});
With both local and global omit, you now have the flexibility to completely remove sensitive fields while also tailoring individual queries. If you need the ability to generally omit a field except in a specific query, you can also overwrite a global omit locally
const prisma = new PrismaClient({
omit: {
user: {
// password is omitted globally.
password: true,
},
},
});
const userWithPassword = await prisma.user.findUnique({
omit: { password: false }, // omit now false, so password is returned
where: { id: 1 },
});
Changes to prismaSchemaFolder
In 5.15.0 we released the prismaSchemaFolder Preview feature, allowing you to create multiple Prisma Schema files in a prisma/schema directory. We’ve gotten a lot of great feedback and are really excited with how the community has been using the feature.
To continue improving our multi-file schema support, we have a few breaking changes to the prismaSchemaFolder feature:
- When using relative paths in Prisma Schema files with the
prismaSchemaFolderfeature, a path is now relative to the file it is defined in rather than relative to theprisma/schemafolder. This means that if you have a generator block in/project/prisma/schema/config/generator.prismawith anoutputof./foothe output will be resolved to/project/prisma/schema/config/foorather than/project/prisma/foo. The path to a SQLite file will be resolved in the same manner. - We realized that during migration many people would have
prisma/schemaas well asprisma/schema.prisma. Our initial implementation looked for a.prismafile first and would ignore theschemafolder if it exists. This is now an error.
Changes to fullTextSearch
In order to improve our full-text search implementation we have made a breaking change to the fullTextSearch Preview feature.
Previously, when the feature was enabled we updated the <Model>OrderByWithRelationInput TypeScript type with the <Model>OrderByWithRelationAndSearchRelevanceInput type. However, we have noted that there are no cases where relational ordering is needed but search relevance is not. Thus, we have decided to remove the <Model>OrderByWithRelationAndSearchRelevanceInput naming and only use the <Model>OrderByWithRelationInput naming.
Fixes and improvements
Prisma
- Wrong Parameterized Types Sent for SQL Server Queries
Prisma has no exported member named OrderByWithRelationInput. Did you mean OrderByWithAggregationInput?- [Driver Adapters]: missing provider compatibility validation
- Disable "Start using Prisma Client" hint logs on
prisma generate - Deploying prisma to CloudFlare pages using Nuxt/Nitro and node-postgres (pg) is using the wrong(vercel) wasm path
@prisma/adapter-pgmodifies node-postgres global type parsers- @prisma/adapter-d1 is failing with an import error when called inside vitest tests
db pullfails with[libs\user-facing-errors\src\quaint.rs:136:18] internal error: entered unreachable codeon invalid credentials
Language tools (e.g. VS Code)
- Make prisma-fmt logs to work with language server
- Spans and positions get shifted out of sync when schema includes multibyte characters
- VSCode extension panics when opening an empty prisma schema
Prisma Engines
- [DA] Planetscale engine tests: one2m_mix_required_writable_readable
- [DA] Planetscale engine tests: apply_number_ops
Credits
Huge thanks to @key-moon, @pranayat, @yubrot, @skyzh, @brian-dlee, @mydea, @nickcarnival, @eruditmorina, @nzakas, @gutyerrez, @avallete, @ceddy4395, @Kayoshi-dev, @yehonatanz for helping!
v5.15.1
Today, we are issuing the 5.15.1 patch release.
Fixes in Prisma Client
- internal error: entered unreachable code
- Got error 'internal error: entered unreachable code' when trying to perform an upsert.
- Prisma Client errors on SQLite with internal error: entered unreachable code when running 2 concurrent upsert
ConnectionError(Timed out during query execution.)during seeding- SQLite timeouts after upgrade from prisma 2 to prisma 4
ConnectionError(Timed out during query execution.)error when usingPromise.allfor SQLite- Improve the error when SQLite database file is locked
- sqlite timeout error multiple queries run one after another
- SQLite times out during query execution when using
Promise.all()/ concurrent - internal error: entered unreachable code
v5.15.0
Today, we are excited to share the 5.15.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Multi-File Prisma Schema support
Prisma ORM 5.15.0 features support for multi-file Prisma Schema in Preview.
This closes a long standing issue and does so in a clean and easy to migrate way.
To get started:
- Enable the
prismaSchemaFolderPreview feature by including it in thepreviewFeaturesfield of yourgenerator.datasource db { provider = "postgresql" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["prismaSchemaFolder"] } - Create a
schemasubdirectory under yourprismadirectory. - Move your
schema.prismainto this directory.
You are now set up with a multi-file Prisma Schema! Add as many or as few .prisma files to the new prisma/schema directory.
When running commands where a Prisma Schema file is expected to be provided, you can now define a Prisma Schema directory. This includes Prisma CLI commands that use the --schema option as well as defining schema via package.json
Our tooling has also been updated to handle multiple Prisma Schema files. This includes our Visual Studio Code extension and tools like database introspection, which will deposit new models in a introspected.prisma file. Existing models will be updated in the file they are found.
To learn more, please refer to our official documentation and [announcem
Configuration
📅 Schedule: Branch creation - "on the first day of the week" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.