nest
nest copied to clipboard
fix(deps): update prisma monorepo to v6 (major)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @prisma/client (source) | 4.16.2 -> 6.0.0 |
||||
| prisma (source) | ^4.15.0 -> ^6.0.0 |
Release Notes
prisma/prisma (@prisma/client)
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 announcement blog post. If you try out prismaSchemaFolder, please let us know!
Interesting Bug Fixes
Fix for PostgreSQL prepared statement caching for raw queries
This release fixes a nasty bug with the caching of prepared statements in raw Prisma Client queries that affected PostgreSQL when you ran the same SQL statement with differently typed paramters. This should not fail any more.
Fix for SQL Server introspection of (deprecated) CREATE DEFAULT
Our Introspection logic crashed on encountering certain multi-line CREATE DEFAULT, a deprecated way to define defaults in SQL Server. As many SQL Server users are working with established databases, this happened frequently enough that we now explicitly ignore these defaults instead of crashing.
Fix for Cloudflare D1’s lower parameter limit
Cloudflare’s D1 has a lower parameter limit than local SQLite, which caused bigger queries to fail. We adapted that limit to the D1 default for @prisma/adapter-d1, which will avoid such failures.
Fix for Cloudflare D1’s different PRAGMA support
Our generated migration SQL for SQLite did not always work for Cloudflare D1, because of differences in the supported pragmas. We adapted the SQL to work in both local SQLite and Cloudflare D1.
Fixes and improvements
Prisma Migrate
- Crash on multiline defaults introspection on MSSQL
- Error: [libs\sql-schema-describer\src\mssql.rs:315:30] called
Result::unwrap()on anErrvalue: "Couldn't parse default value:create default [dbo].[member_notification_cancel_flags] as 0\r\n" - Error: [libs\sql-schema-describer\src\mssql.rs:315:30] called
Result::unwrap()on anErrvalue: "Couldn't parse default value:create default d_password as 'D,73'" - Crash introspecting MSSQL database with
DEFAULTs - doing introspection on a SQL Server 2018 DB - for Dynamic GP get the following error.
- Error: [libs\sql-schema-describer\src\mssql.rs:317:30] called
Result::unwrap()on anErrvalue: "Couldn't parse default value:\r\ncreate default D_BIT_OFF\r\nas 0\r\n" - Error: called
Result::unwrap()on anErrvalue: "Couldn't parse default value in SQL Server - db pull errors on SQL Server with
Error: [libs\sql-schema-describer\src\mssql.rs:336:30] calledResult::unwrap()on anErrvalue: "Couldn't parse default value: [...] - Error: [libs\sql-schema-describer\src\mssql.rs:336:30] called
Result::unwrap()on anErrvalue: "Couldn't parse default value:\r\ncreate default [va_nulla] as 0\r\n" - Error when pulling from database
- Foreign key relation results in erroneous second migration
db pullcan't parse script setting default value- Bug: Migrations not compatible with D1
- SQL Server Introspection crashes on multi-line (deprecated) defaults
Prisma Client
- Raw query failed. Code:
22P03. Message:db error: ERROR: incorrect binary data format in bind parameter 1 - Float number on raw query:
incorrect binary data format in bind parameter 1 - Can't use Prisma client in Next.js middleware, even when deploying to Node.js
- Prepared statement caching is data dependent on numeric input parameters (
incorrect binary data format in bind parameter x) - Turso Driver Adapter: Including
_countleads to error - Next.js app build fails when using Prisma with DB driver in Server Action
- Bug: [D1] Error in performIO: Error: D1_ERROR: too many SQL variables
- Remove
warn(prisma-client) This is the 10th instance of Prisma Client being started.warning in Edge (and potentially) other envs) - $executeRawUnsafe:
incorrect binary data format in bind parameter 6 - Bug: Error or bug using Prisma with DriverAdapter with PostgreSQL database Neon
Inconsistent column data: Unexpected conversion failure from Number to BigInterror when using@prisma/adapter-pg- Incompatibility with NextJS app dir, CloudFlare Pages and D1
- Breaking change?
Intswitched to beingInt32for MongoDB
Language tools (e.g. VS Code)
- VS Code extension is showing an advertisement
Generatecodelens fails on Windows- We incorrectly read commented out preview features if they are before the real preview features
Credits
Huge thanks to @pranayat, @yubrot, and @skyzh for helping!
v5.14.0
Today, we are excited to share the 5.14.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release. 🌟
Highlights
Share your feedback about Prisma ORM
We want to know how you like working with Prisma ORM in your projects! Please take our 2min survey and let us know what you like or where we can improve 🙏
createManyAndReturn()
We’re happy to announce the availability of a new, top-level Prisma Client query: createManyAndReturn(). It works similarly to createMany() but uses a RETURNING clause in the SQL query to retrieve the records that were just created.
Here’s an example of creating multiple posts and then immediately returning those posts.
const postBodies = req.json()['posts']
const posts = prisma.post.createManyAndReturn({
data: postBodies
});
return posts
Additionally,createManyAndReturn() supports the same options as findMany(), such as the ability to return only specific fields.
const postBodies = req.json()['posts']
const postTitles = prisma.post.createManyAndReturn({
data: postBodies,
select: {
title: true,
},
});
return postTitles
Note: Because createManyAndReturn() uses the RETURNING clause, it is only supported by PostgreSQL, CockroachDB, and SQLite databases. At this time, relationLoadStrategy: join is not supported in createManyAndReturn() queries.
MongoDB performance improvements
Previously, Prisma ORM suffered from performance issues when using the in operator or when including related models in queries against a MongoDB database. These queries were translated by the Prisma query engine in such a way that indexes were skipped and collection scans were used, leading to slower queries especially on large datasets.
With 5.14.0, Prisma ORM now rewrites queries to use a combination of $or and $eq operators, leading to dramatic performance increases for queries that include in operators or relation loading.
Fixes and improvements
Prisma Client
createMany()should return the created records- Generating Prisma client without any model in its schema
- MongoDB: Performance issue with nested
takeon many-to-one relationship - Slow queries on MongoDB using
includefor relations - [MongoDB] Performance issue in
findMany()query execution within - MongoDB nested/
includequery slow - MongoDB Connector generates queries which do not take advantage of indices.
- Mongodb Nested Queries Not Using Indexes
- MongoDB slow delete with
onDelete: SetNull - Slow query with many-to-one relationship on MongoDB
prisma init --with-model- Fixed version of
@opentelemetry/*dependencies - Usage of deprecated punycode module
- Bug: D1 One-to-Many Relation INSERTs fail with
The required connected records were not found.when using indices
Prisma Migrate
- Empty
dbgenerated()still breaking forUnsupported()types - Validation error when
shadowDatabaseUrlis identical tourl(ordirectUrl) - MongoDB Query with 'in' condition will cause COLLSCAN, without leveraging indexes
- "Not Authorised" when directly applying Prisma generated migrations to Cloudflare D1 with
PRAGMA foreign_key_check;
Language tools (e.g. VS Code)
Company news
Prisma Changelog
Curious about all things Prisma? Be sure to check out the Prisma Changelog for updates across Prisma's products, including ORM, Accelerate, and Pulse!
Credits
Huge thanks to @pranayat, @yubrot, @skyzh, @anuraaga, @gutyerrez, @avallete, @ceddy4395, @Kayoshi-dev for helping!
v5.13.0
Today, we are excited to share the 5.13.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release.
Highlights
omit fields from Prisma Client queries (Preview)
We’re excited to announce Preview support for the omit option within the Prisma Client query options. The highly-requested omit feature now allows you to exclude fields that you don’t want to retrieve from the database on a per-query basis.
By default, when a query returns records, the result includes all scalar fields of the models defined in the Prisma schema. select can be used to return specific fields, while omit can now be used to exclude specific fields. omit lives at the same API level and works on all of the same Prisma Client model queries as select. Note, however, that omit and select are mutually exclusive. In other words, you can’t use both in the same query.
To get started using omit, enable the omitApi Preview feature in your Prisma schema:
// schema.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["omitApi"]
}
Be sure to re-generate Prisma Client afterwards:
npx prisma generate
Here is an example of using omit:
// Includes all fields except password
await prisma.user.findMany({
omit: {
password: true
},
})
Here is an example of using omit with include:
// Includes all user fields except user's password and title of user's posts
await prisma.user.findMany({
omit: {
password: true
},
include: {
posts: {
omit: {
title: true
},
},
},
})
Expand to view the example Prisma schema
model User {
id Int @​id @​default(autoincrement())
email String @​unique
name String?
password String
posts Post[]
}
model Post {
id Int @​id @​default(autoincrement())
title String
author User @​relation(fields: [authorId], references: [id])
authorId Int
}
Many users have requested a global implementation of omit. This request will be accommodated in the future. In the meantime, you can follow the issue here.
📣 Share your feedback: omitApi Preview feature
📚 Documentation: omit - Prisma Client API Reference
Fixes and improvements
Prisma Migrate
Prisma Client
Credits
Huge thanks to @ospfranco, @pranayat, @yubrot, @skyzh, @anuraaga, @yehonatanz, @arthurfiorette, @elithrar, @tockn, @Kuhave, @obiwac for helping!
v5.12.1
Today, we are issuing the 5.12.1 patch release to fix two small problems with our new Cloudflare D1 support.
Fixes in Prisma CLI
Windows-only fix for new D1 specific flags for migrate diff and db pull
The flags --from-local-d1 and `--to-local-
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), 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.
Pull Request Test Coverage Report for Build 558bb6aa-0c4c-413e-8aa1-51710fe0d1cf
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 92.208%
| Totals | |
|---|---|
| Change from base Build 9803a2b2-ae11-4df7-b76d-888d06cb0324: | 0.0% |
| Covered Lines: | 6745 |
| Relevant Lines: | 7315 |
💛 - Coveralls
⚠ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
- any of the package files in this branch needs updating, or
- the branch becomes conflicted, or
- you click the rebase/retry checkbox if found above, or
- you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: sample/22-graphql-prisma/package-lock.json
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/reflect-metadata
npm WARN reflect-metadata@"0.2.1" from the root project
npm WARN 4 more (@nestjs/graphql, @nestjs/mapped-types, @nestjs/common, @nestjs/core)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer reflect-metadata@"^0.1.13" from @nestjs/[email protected]
npm WARN node_modules/@nestjs/graphql
npm WARN @nestjs/graphql@"12.0.11" from the root project
npm WARN 1 more (@nestjs/apollo)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/reflect-metadata
npm WARN reflect-metadata@"0.2.1" from the root project
npm WARN 4 more (@nestjs/graphql, @nestjs/mapped-types, @nestjs/common, @nestjs/core)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer reflect-metadata@"^0.1.13" from @nestjs/[email protected]
npm WARN node_modules/@nestjs/graphql
npm WARN @nestjs/graphql@"12.0.11" from the root project
npm WARN 1 more (@nestjs/apollo)
npm WARN ERESOLVE overriding peer dependency
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nestjs/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/ts-morph
npm ERR! dev ts-morph@"21.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional ts-morph@"^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/graphql
npm ERR! @nestjs/graphql@"12.0.11" from the root project
npm ERR! peer @nestjs/graphql@"^12.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"12.0.11" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/ts-morph
npm ERR! peerOptional ts-morph@"^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/graphql
npm ERR! @nestjs/graphql@"12.0.11" from the root project
npm ERR! peer @nestjs/graphql@"^12.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"12.0.11" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /tmp/renovate/cache/others/npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/renovate/cache/others/npm/_logs/2024-04-23T13_35_30_748Z-debug-0.log
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
- any of the package files in this branch needs updating, or
- the branch becomes conflicted, or
- you click the rebase/retry checkbox if found above, or
- you rename this PR's title to start with "rebase!" to trigger it manually
The artifact failure details are included below:
File name: sample/22-graphql-prisma/package-lock.json
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nestjs/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/reflect-metadata
npm ERR! reflect-metadata@"0.2.1" from the root project
npm ERR! peer reflect-metadata@"^0.1.12 || ^0.2.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! @nestjs/common@"10.3.2" from the root project
npm ERR! peer @nestjs/common@"^9.3.8 || ^10.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"12.0.11" from the root project
npm ERR! 5 more (@nestjs/core, @nestjs/graphql, @nestjs/mapped-types, ...)
npm ERR! 1 more (@nestjs/core)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer reflect-metadata@"^0.1.13" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/graphql
npm ERR! @nestjs/graphql@"12.0.11" from the root project
npm ERR! peer @nestjs/graphql@"^12.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"12.0.11" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/reflect-metadata
npm ERR! peer reflect-metadata@"^0.1.13" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/graphql
npm ERR! @nestjs/graphql@"12.0.11" from the root project
npm ERR! peer @nestjs/graphql@"^12.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/apollo
npm ERR! @nestjs/apollo@"12.0.11" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /tmp/renovate/cache/others/npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/renovate/cache/others/npm/_logs/2024-08-06T16_15_14_911Z-debug-0.log