prisma/prisma (prisma)
### [`v5.22.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.22.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.21.1...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.22.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.22.0) 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](https://redirect.github.com/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
- [removing `@unique` in `schema.prisma` does not generate SQL to do so](https://redirect.github.com/prisma/prisma/issues/12732)
##### Prisma
- [Prisma generate randomly fails on Ubuntu due to missing internal .so `libquery_engine-debian-openssl-1.1.x.so.node`](https://redirect.github.com/prisma/prisma/issues/19124)
- [Timed out fetching a new connection from the connection pool. ](https://redirect.github.com/prisma/prisma/issues/25162)
##### Credits
Huge thanks to [@tmm1](https://redirect.github.com/tmm1), [@Takur0](https://redirect.github.com/Takur0), [@hinaloe](https://redirect.github.com/hinaloe), [@andyjy](https://redirect.github.com/andyjy), and [@youxq](https://redirect.github.com/youxq) for helping!
### [`v5.21.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.21.1)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.21.0...5.21.1)
- Fixed a bug where migrations were not using shadow database correctly in some edge cases
### [`v5.21.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.21.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.20.0...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.21.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.21.0) 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](https://www.prisma.io/docs/orm/prisma-client/observability-and-logging/opentelemetry-tracing).
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](https://pris.ly/gh/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](https://www.prisma.io/docs/orm/overview/databases/database-drivers#driver-adapters), going over the 1 MB limit on the free tier of Cloudflare Workers. This has now been fixed.
##### Fixes and improvements
##### Prisma Engines
- [Avoid regex crate for wasm bundle size (to keep cloudflare free plan)](https://redirect.github.com/prisma/prisma-engines/issues/5008)
##### Credits
Huge thanks to [@austin-tildei](https://redirect.github.com/austin-tildei), [@LucianBuzzo](https://redirect.github.com/LucianBuzzo), [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh) for helping!
### [`v5.20.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.20.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.19.1...5.20.0)
🌟 **Help us spread the word about Prisma by starring the repo or [posting on X](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.20.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.20.0) 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](https://redirect.github.com/prisma/prisma/issues/20169) and follows [our latest proposal](https://redirect.github.com/prisma/prisma/issues/20169#issuecomment-2338360300) on the same issue.
To demonstrate the change, take the following code snippet:
```tsx
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:
```tsx
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.
```tsx
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](https://redirect.github.com/prisma/prisma/discussions/25271).
##### `typedSql` bug fix
Thank you to everyone who has tried out our [`typedSql` Preview feature](https://www.prisma.io/blog/announcing-typedsql-make-your-raw-sql-queries-type-safe-with-prisma-orm) and [provided feedback](https://redirect.github.com/prisma/prisma/discussions/25106)! 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`.](https://redirect.github.com/prisma/prisma/issues/24072)
- [Invalid TypeScript files created by `generate` when typedSql is enabled and enum contains hyphens.](https://redirect.github.com/prisma/prisma/issues/25163)
- [`@prisma/internals` didn't list `ts-toolbelt` in dependencies.](https://redirect.github.com/prisma/prisma/issues/17952)
- [using `$extends` prevents model comments from being passed to TypeScript](https://redirect.github.com/prisma/prisma/issues/24648)
##### Prisma Engines
- [Planetscale engine tests: interactive_tx](https://redirect.github.com/prisma/prisma-engines/issues/4469)
- [Fix broken engine size publishing workflow](https://redirect.github.com/prisma/prisma-engines/issues/4991)
##### Credits
Huge thanks to [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@thijmenjk](https://redirect.github.com/thijmenjk), [@mydea](https://redirect.github.com/mydea), [@HRM](https://redirect.github.com/HRM), [@haaawk](https://redirect.github.com/haaawk), [@baileywickham](https://redirect.github.com/baileywickham), [@brian-dlee](https://redirect.github.com/brian-dlee), [@nickcarnival](https://redirect.github.com/nickcarnival), [@eruditmorina](https://redirect.github.com/eruditmorina), [@nzakas](https://redirect.github.com/nzakas), and [@gutyerrez](https://redirect.github.com/gutyerrez) for helping!
### [`v5.19.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.19.1)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.19.0...5.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://redirect.github.com/prisma/prisma/issues/25103)
- [https://github.com/prisma/prisma/issues/25137](https://redirect.github.com/prisma/prisma/issues/25137)
- [https://github.com/prisma/prisma/issues/25104](https://redirect.github.com/prisma/prisma/issues/25104)
- [https://github.com/prisma/prisma/issues/25101](https://redirect.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`](https://redirect.github.com/prisma/prisma/releases/tag/5.19.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.18.0...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.19.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.19.0) 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:
1. Make sure that you have the latest version of `prisma` and `@prisma/client` installed:
npm install -D prisma@latest
npm install @prisma/client@latest
2. Enable the `typedSql` Preview feature in your Prisma Schema.
generator client {
provider = "prisma-client-js"
previewFeatures = ["typedSql"]
}
3. Create a `sql` subdirectory of your `prisma` directory.
mkdir -p prisma/sql
4. You can now add `.sql` files to the `sql` directory! Each file can contain one sql query and the name must be a valid JS identifier. For this example, say you had the file `getUsersWithPosts.sql` with the following contents:
```sql
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
```
5. Import your SQL query into your code with the `@prisma/client/sql` import:
```tsx
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](https://pris.ly/typedsql-blog).
For docs, check out our new [TypedSQL section](https://pris.ly/d/typedsql).
##### 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](https://redirect.github.com/prisma/prisma-engines/pull/4970) and [https://github.com/prisma/prisma/pull/24922](https://redirect.github.com/prisma/prisma/pull/24922)
- Mathematic operations such as `max`, `min`, `eq`, etc in queries when using Cloudflare D1.
- Resolved issues when comparing `BigInt` IDs when `relationMode="prisma"` was enabled and Cloudflare D1 was being used.
##### Joins
- [https://github.com/prisma/prisma/issues/23742](https://redirect.github.com/prisma/prisma/issues/23742) fixes Prisma Client not supporting deeply nested `some` clauses when the `relationJoins` Preview 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)](https://boards.greenhouse.io/prisma/jobs/5350820002): 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)](https://boards.greenhouse.io/prisma/jobs/6940273002): This person will be focused on the `prisma-engines` Rust codebase. TypeScript knowledge (or, again, a desire to learn) is a plus.
##### Credits
Huge thanks to [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@Druue](https://redirect.github.com/Druue), [@key-moon](https://redirect.github.com/key-moon), [@Jolg42](https://redirect.github.com/Jolg42), [@pranayat](https://redirect.github.com/pranayat), [@ospfranco](https://redirect.github.com/ospfranco), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh) for helping!
### [`v5.18.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.18.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.17.0...5.18.0)
🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.18.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.18.0) 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.
```tsx
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`](https://redirect.github.com/prisma/prisma/issues/24779).
- [Empty `Json[]` fields will now return `[]` instead of `null` when accessed through a join using the `relationJoins` Preview feature.](https://redirect.github.com/prisma/prisma/issues/22923)
##### Fixes and improvements
##### Prisma
- [Support UUID v7](https://redirect.github.com/prisma/prisma/issues/24079)
##### Language tools (e.g. VS Code)
- [Support fetching references for a model](https://redirect.github.com/prisma/language-tools/issues/982)
##### Credits
Huge thanks to [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@Druue](https://redirect.github.com/Druue), [@key-moon](https://redirect.github.com/key-moon), [@Jolg42](https://redirect.github.com/Jolg42), [@pranayat](https://redirect.github.com/pranayat), [@ospfranco](https://redirect.github.com/ospfranco), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh), [@haaawk](https://redirect.github.com/haaawk) for helping!
### [`v5.17.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.17.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.16.2...5.17.0)
🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.17.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.17.0) 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
![references](https://redirect.github.com/user-attachments/assets/b7d82584-2be7-4db6-bfd9-4dbe46f9e865)
**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.
![image](https://redirect.github.com/user-attachments/assets/b0dbc818-374b-4b6d-bda5-974d66efca65)
**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.
![image (1)](https://redirect.github.com/user-attachments/assets/931e8dff-2b1e-4da7-bd17-5b844d12804e)
##### 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
- [Remove or change `This is the 10th instance of Prisma Client being started. Make sure this is intentional.` warning](https://redirect.github.com/prisma/prisma/issues/23736)
##### Prisma
- [Prisma generate option --allow-no-models doesn't work.](https://redirect.github.com/prisma/prisma/issues/24737)
##### Language tools (e.g. VS Code)
- [LSP Rename incorrectly maps field name and appends character](https://redirect.github.com/prisma/language-tools/issues/1771)
##### Credits
Huge thanks to [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh) for helping!
### [`v5.16.2`](https://redirect.github.com/prisma/prisma/releases/tag/5.16.2)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.16.1...5.16.2)
Today, we are issuing the 5.16.2 patch release to fix an issue in Prisma client.
#### Fix in Prisma Client
- [nextjs app deployed to vercel edge can't import prisma WASM modul ](https://redirect.github.com/prisma/prisma/issues/24673)
### [`v5.16.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.16.1)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.16.0...5.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 ](https://redirect.github.com/prisma/prisma/issues/24634)
- [Prisma Seed Script Fails After Upgrading to v5.16.0 (DATABASE_URL Error)](https://redirect.github.com/prisma/prisma/issues/24658)
### [`v5.16.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.16.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.15.1...5.16.0)
🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.16.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.16.0) 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.
```tsx
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
```tsx
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
```tsx
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](https://redirect.github.com/prisma/prisma/discussions/24413) 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 `prismaSchemaFolder` feature, a path is now relative to the file it is defined in rather than relative to the `prisma/schema` folder. This means that if you have a generator block in `/project/prisma/schema/config/generator.prisma` with an `output` of `./foo` the output will be resolved to `/project/prisma/schema/config/foo` rather 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/schema` as well as `prisma/schema.prisma`. Our initial implementation looked for a `.prisma` file first and would ignore the `schema` folder 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 `OrderByWithRelationInput` TypeScript type with the `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 `OrderByWithRelationAndSearchRelevanceInput` naming and only use the `OrderByWithRelationInput` naming.
##### Fixes and improvements
##### Prisma
- [Wrong Parameterized Types Sent for SQL Server Queries](https://redirect.github.com/prisma/prisma/issues/17565)
- [`Prisma has no exported member named OrderByWithRelationInput. Did you mean OrderByWithAggregationInput?`](https://redirect.github.com/prisma/prisma/issues/21017)
- [\[Driver Adapters\]: missing provider compatibility validation](https://redirect.github.com/prisma/prisma/issues/21864)
- [Disable "Start using Prisma Client" hint logs on `prisma generate`](https://redirect.github.com/prisma/prisma/issues/22513)
- [Deploying prisma to CloudFlare pages using Nuxt/Nitro and node-postgres (pg) is using the wrong(vercel) wasm path](https://redirect.github.com/prisma/prisma/issues/23500)
- [`@prisma/adapter-pg` modifies node-postgres global type parsers](https://redirect.github.com/prisma/prisma/issues/23505)
- [@prisma/adapter-d1 is failing with an import error when called inside vitest tests](https://redirect.github.com/prisma/prisma/issues/23911)
- [`db pull` fails with `[libs\user-facing-errors\src\quaint.rs:136:18] internal error: entered unreachable code` on invalid credentials](https://redirect.github.com/prisma/prisma/issues/24268)
##### Language tools (e.g. VS Code)
- [Make prisma-fmt logs to work with language server](https://redirect.github.com/prisma/language-tools/issues/1193)
- [Spans and positions get shifted out of sync when schema includes multibyte characters](https://redirect.github.com/prisma/language-tools/issues/1308)
- [VSCode extension panics when opening an empty prisma schema](https://redirect.github.com/prisma/language-tools/issues/1760)
##### Prisma Engines
- [\[DA\] Planetscale engine tests: one2m_mix_required_writable_readable](https://redirect.github.com/prisma/prisma-engines/issues/4482)
- [\[DA\] Planetscale engine tests: apply_number_ops](https://redirect.github.com/prisma/prisma-engines/issues/4485)
##### Credits
Huge thanks to [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh), [@brian-dlee](https://redirect.github.com/brian-dlee), [@mydea](https://redirect.github.com/mydea), [@nickcarnival](https://redirect.github.com/nickcarnival), [@eruditmorina](https://redirect.github.com/eruditmorina), [@nzakas](https://redirect.github.com/nzakas), [@gutyerrez](https://redirect.github.com/gutyerrez), [@avallete](https://redirect.github.com/avallete), [@ceddy4395](https://redirect.github.com/ceddy4395), [@Kayoshi-dev](https://redirect.github.com/Kayoshi-dev), [@yehonatanz](https://redirect.github.com/yehonatanz) for helping!
### [`v5.15.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.15.1)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.15.0...5.15.1)
Today, we are issuing the `5.15.1` patch release.
##### Fixes in Prisma Client
- [internal error: entered unreachable code](https://redirect.github.com/prisma/prisma/issues/23407)
- [Got error 'internal error: entered unreachable code' when trying to perform an upsert.](https://redirect.github.com/prisma/prisma/issues/22947)
- [Prisma Client errors on SQLite with internal error: entered unreachable code when running 2 concurrent upsert ](https://redirect.github.com/prisma/prisma/issues/22725)
- [`ConnectionError(Timed out during query execution.)` during seeding](https://redirect.github.com/prisma/prisma/issues/21772)
- [SQLite timeouts after upgrade from prisma 2 to prisma 4](https://redirect.github.com/prisma/prisma/issues/17029)
- [`ConnectionError(Timed out during query execution.)` error when using `Promise.all` for SQLite](https://redirect.github.com/prisma/prisma/issues/11789)
- [Improve the error when SQLite database file is locked](https://redirect.github.com/prisma/prisma/issues/10403)
- [sqlite timeout error multiple queries run one after another](https://redirect.github.com/prisma/prisma/issues/10306)
- [SQLite times out during query execution when using `Promise.all()` / concurrent](https://redirect.github.com/prisma/prisma/issues/9562)
- [internal error: entered unreachable code](https://redirect.github.com/prisma/prisma/issues/24511)
### [`v5.15.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.15.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.14.0...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.15.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.15.0) 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](https://redirect.github.com/prisma/prisma/issues/2377) and does so in a clean and easy to migrate way.
To get started:
1. Enable the `prismaSchemaFolder` Preview feature by including it in the `previewFeatures` field of your `generator`.
```prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["prismaSchemaFolder"]
}
```
2. Create a `schema` subdirectory under your `prisma` directory.
3. Move your `schema.prisma` into 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](https://www.prisma.io/blog/organize-your-prisma-schema-with-multi-file-support). If you try out `prismaSchemaFolder`, please [let us know](https://redirect.github.com/prisma/prisma/discussions/24413)!
##### Interesting Bug Fixes
##### Fix for PostgreSQL prepared statement caching for raw queries
This release fixes a [nasty bug with the caching of prepared statements](https://redirect.github.com/prisma/prisma/issues/22482) in [raw Prisma Client queries](https://www.prisma.io/docs/orm/prisma-client/queries/raw-database-access/raw-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](https://redirect.github.com/prisma/prisma/issues/24275) on encountering certain multi-line `CREATE DEFAULT`, a [deprecated way to define defaults in SQL Server](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-default-transact-sql?view=sql-server-ver15). 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](https://redirect.github.com/prisma/prisma/issues/23743). 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](https://redirect.github.com/prisma/prisma/issues/24208), 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](https://redirect.github.com/prisma/prisma/issues/10123)
- [Error: \[libs\sql-schema-describer\src\mssql.rs:315:30\] called `Result::unwrap()` on an `Err` value: "Couldn't parse default value: `create default [dbo].[member_notification_cancel_flags] as 0\r\n`" ](https://redirect.github.com/prisma/prisma/issues/10740)
- [Error: \[libs\sql-schema-describer\src\mssql.rs:315:30\] called `Result::unwrap()` on an `Err` value: "Couldn't parse default value: ` create default d_password as 'D,73' `" ](https://redirect.github.com/prisma/prisma/issues/11010)
- [Crash introspecting MSSQL database with `DEFAULT`s](https://redirect.github.com/prisma/prisma/issues/11557)
- [doing introspection on a SQL Server 2018 DB - for Dynamic GP get the following error.](https://redirect.github.com/prisma/prisma/issues/14200)
- [Error: \[libs\sql-schema-describer\src\mssql.rs:317:30\] called `Result::unwrap()` on an `Err` value: "Couldn't parse default value: `\r\ncreate default D_BIT_OFF\r\nas 0\r\n`" ](https://redirect.github.com/prisma/prisma/issues/15704)
- [Error: called `Result::unwrap()` on an `Err` value: "Couldn't parse default value in SQL Server](https://redirect.github.com/prisma/prisma/issues/17069)
- [db pull errors on SQL Server with ` Error: [libs\sql-schema-describer\src\mssql.rs:336:30] called `Result::unwrap()`on an`Err` value: "Couldn't parse default value: [...] `](https://redirect.github.com/prisma/prisma/issues/17104)
- [Error: \[libs\sql-schema-describer\src\mssql.rs:336:30\] called `Result::unwrap()` on an `Err` value: "Couldn't parse default value: `\r\ncreate default [va_nulla] as 0\r\n`" ](https://redirect.github.com/prisma/prisma/issues/17292)
- [Error when pulling from database](https://redirect.github.com/prisma/prisma/issues/19971)
- [Foreign key relation results in erroneous second migration](https://redirect.github.com/prisma/prisma/issues/23043)
- [`db pull` can't parse script setting default value](https://redirect.github.com/prisma/prisma/issues/23453)
- [Bug: Migrations not compatible with D1](https://redirect.github.com/prisma/prisma/issues/24208)
- [SQL Server Introspection crashes on multi-line (deprecated) defaults](https://redirect.github.com/prisma/prisma/issues/24275)
##### Prisma Client
- [Raw query failed. Code: `22P03`. Message: `db error: ERROR: incorrect binary data format in bind parameter 1`](https://redirect.github.com/prisma/prisma/issues/16611)
- [Float number on raw query: `incorrect binary data format in bind parameter 1`](https://redirect.github.com/prisma/prisma/issues/17110)
- [Can't use Prisma client in Next.js middleware, even when deploying to Node.js](https://redirect.github.com/prisma/prisma/issues/21310)
- [Prepared statement caching is data dependent on numeric input parameters (`incorrect binary data format in bind parameter x`)](https://redirect.github.com/prisma/prisma/issues/22482)
- [Turso Driver Adapter: Including `_count` leads to error](https://redirect.github.com/prisma/prisma/issues/23566)
- [Next.js app build fails when using Prisma with DB driver in Server Action](https://redirect.github.com/prisma/prisma/issues/23600)
- [Bug: \[D1\] Error in performIO: Error: D1\_ERROR: too many SQL variables](https://redirect.github.com/prisma/prisma/issues/23743)
- [Remove `warn(prisma-client) This is the 10th instance of Prisma Client being started.` warning in Edge (and potentially) other envs)](https://redirect.github.com/prisma/prisma/issues/23763)
- [$executeRawUnsafe: `incorrect binary data format in bind parameter 6`](https://redirect.github.com/prisma/prisma/issues/23872)
- [Bug: Error or bug using Prisma with DriverAdapter with PostgreSQL database Neon](https://redirect.github.com/prisma/prisma/issues/23903)
- [`Inconsistent column data: Unexpected conversion failure from Number to BigInt` error when using `@prisma/adapter-pg` ](https://redirect.github.com/prisma/prisma/issues/23926)
- [Incompatibility with NextJS app dir, CloudFlare Pages and D1](https://redirect.github.com/prisma/prisma/issues/23929)
- [Breaking change? `Int` switched to being `Int32` for MongoDB](https://redirect.github.com/prisma/prisma/issues/24262)
##### Language tools (e.g. VS Code)
- [VS Code extension is showing an advertisement](https://redirect.github.com/prisma/language-tools/issues/1732)
- [`Generate` codelens fails on Windows](https://redirect.github.com/prisma/language-tools/issues/1738)
- [We incorrectly read commented out preview features if they are before the real preview features](https://redirect.github.com/prisma/language-tools/issues/1741)
##### Credits
Huge thanks to [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), and [@skyzh](https://redirect.github.com/skyzh) for helping!
### [`v5.14.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.14.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.13.0...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.14.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.14.0) 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](https://pris.ly/orm/survey/release-5-14) 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.
```tsx
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.
```tsx
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](https://redirect.github.com/prisma/prisma/issues/8131)
- [Generating Prisma client without any model in its schema](https://redirect.github.com/prisma/prisma/issues/11582)
- [MongoDB: Performance issue with nested `take` on many-to-one relationship](https://redirect.github.com/prisma/prisma/issues/13865)
- [Slow queries on MongoDB using `include` for relations](https://redirect.github.com/prisma/prisma/issues/15156)
- [\[MongoDB\] Performance issue in `findMany()` query execution with `in`](https://redirect.github.com/prisma/prisma/issues/15983)
- [MongoDB nested/`include` query slow](https://redirect.github.com/prisma/prisma/issues/17142)
- [MongoDB Connector generates queries which do not take advantage of indices.](https://redirect.github.com/prisma/prisma/issues/17396)
- [Mongodb Nested Queries Not Using Indexes](https://redirect.github.com/prisma/prisma/issues/18025)
- [MongoDB slow delete with `onDelete: SetNull`](https://redirect.github.com/prisma/prisma/issues/19169)
- [Slow query with many-to-one relationship on MongoDB](https://redirect.github.com/prisma/prisma/issues/20600)
- [`prisma init --with-model`](https://redirect.github.com/prisma/prisma/issues/20915)
- [Fixed version of `@opentelemetry/*` dependencies](https://redirect.github.com/prisma/prisma/issues/21473)
- [Usage of deprecated punycode module](https://redirect.github.com/prisma/prisma/issues/21644)
- [Bug: D1 One-to-Many Relation INSERTs fail with `The required connected records were not found.` when using indices](https://redirect.github.com/prisma/prisma/issues/23902)
##### Prisma Migrate
- [Empty `dbgenerated()` still breaking for `Unsupported()` types](https://redirect.github.com/prisma/prisma/issues/15654)
- [Validation error when `shadowDatabaseUrl` is identical to `url` (or `directUrl`)](https://redirect.github.com/prisma/prisma/issues/16628)
- [MongoDB Query with 'in' condition will cause COLLSCAN, without leveraging indexes](https://redirect.github.com/prisma/prisma/issues/19955)
- ["Not Authorised" when directly applying Prisma generated migrations to Cloudflare D1 with `PRAGMA foreign_key_check;`](https://redirect.github.com/prisma/prisma/issues/23827)
##### Language tools (e.g. VS Code)
- [make superior: model generate](https://redirect.github.com/prisma/language-tools/issues/1651)
- [Missing code autocomplete for referential actions with mongodb](https://redirect.github.com/prisma/language-tools/issues/1676)
##### Company news
##### Prisma Changelog
Curious about all things Prisma? Be sure to check out the [Prisma Changelog](https://www.prisma.io/changelog) for updates across Prisma's products, including ORM, Accelerate, and Pulse!
##### Credits
Huge thanks to [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh), [@anuraaga](https://redirect.github.com/anuraaga), [@gutyerrez](https://redirect.github.com/gutyerrez), [@avallete](https://redirect.github.com/avallete), [@ceddy4395](https://redirect.github.com/ceddy4395), [@Kayoshi-dev](https://redirect.github.com/Kayoshi-dev) for helping!
### [`v5.13.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.13.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.12.1...5.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](https://twitter.com/intent/post?text=Check%20out%20the%20latest%20%40prisma%20release%20v5.13.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps%3A%2F%2Fgithub.com%2Fprisma%2Fprisma%2Freleases%2Ftag%2F5.13.0) 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](https://redirect.github.com/prisma/prisma/issues/5042) `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`](https://www.prisma.io/docs/orm/reference/prisma-client-reference#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](https://www.prisma.io/docs/orm/reference/prisma-client-reference#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:
```prisma
// schema.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["omitApi"]
}
```
Be sure to re-generate Prisma Client afterwards:
```bash
npx prisma generate
```
Here is an example of using `omit`:
```ts
// Includes all fields except password
await prisma.user.findMany({
omit: {
password: true
},
})
```
Here is an example of using `omit` with `include`:
```ts
// 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
```prisma
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](https://redirect.github.com/prisma/prisma/issues/5042).
**📣 Share your feedback:** [`omitApi` Preview feature](https://redirect.github.com/prisma/prisma/discussions/23924)
**📚 Documentation:** [`omit` - Prisma Client API Reference](https://www.prisma.io/docs/orm/reference/prisma-client-reference#omit-preview)
##### Fixes and improvements
##### Prisma Migrate
- [Nicer Datamodel Type validation](https://redirect.github.com/prisma/prisma/issues/15174)
##### Prisma Client
- [`✘ [ERROR] near "��": syntax error at offset 0` when running `wrangler d1 migrations apply` with Prisma generated migration (on Windows, using Powershell)](https://redirect.github.com/prisma/prisma/issues/23702)
##### Credits
Huge thanks to [@ospfranco](https://redirect.github.com/ospfranco), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh), [@anuraaga](https://redirect.github.com/anuraaga), [@yehonatanz](https://redirect.github.com/yehonatanz), [@arthurfiorette](https://redirect.github.com/arthurfiorette), [@elithrar](https://redirect.github.com/elithrar), [@tockn](https://redirect.github.com/tockn), [@Kuhave](https://redirect.github.com/Kuhave), [@obiwac](https://redirect.github.com/obiwac) for helping!
### [`v5.12.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.12.1)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.12.0...5.12.1)
Today, we are issuing the `5.12.1` patch release to fix two small problems with our [new Cloudflare D1 support](https://www.prisma.io/blog/build-applications-at-the-edge-with-prisma-orm-and-cloudflare-d1-preview).
##### 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-d1` for `migrate diff` and `--local-d1` to `db pull` we added in 5.12.0 were not working as expected when running on Windows only. This is now fixed.
📚 **Documentation:** [Deploying a Cloudflare worker with D1 and Prisma ORM](https://prisma.io/docs/orm/overview/databases/cloudflare-d1#how-to-connect-to-d1-in-cloudflare-workers-or-cloudflare-pages)
##### New option for `migrate diff`: `-o` or `--output`
We added a new parameter `--output` to `migrate diff` that can be used to provide a filename into which the output of the command will be written. This is particularly useful for Windows users, using PowerShell, as using `>` to write into a file creates a UTF-16 LE file that can not be read by `wrangler d1 migrations apply`. Using this new option, this problem can be avoided:
```sh
npx prisma migrate diff --script --from-empty --to-schema-datamodel ./prisma/schema.prisma --output ./schema.sql
```
Related issues:
- [`✘ [ERROR] near "��": syntax error at offset 0` when running `wrangler d1 migrations apply` with Prisma generated migration (on Windows, using PowerShell) #23702](https://redirect.github.com/prisma/prisma/issues/23702)
- `[prisma migrate resolve --applied` not working on new project, `migration ... could not be found.`]\[https://github.com/prisma/prisma/issues/17558](https://redirect.github.com/prisma/prisma/issues/17558)8)
### [`v5.12.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.12.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.11.0...5.12.0)
Today, we are excited to share the `5.12.0` stable release 🎉
🌟 **Help us spread the word about Prisma by starring the repo or [posting on X](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.12.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.12.0) about the release.**
##### Highlights
##### Cloudflare D1 (Preview)
This release brings Preview support for [Cloudflare D1](https://developers.cloudflare.com/d1/) with Prisma ORM 🥳
D1 is Cloudflare’s SQLite database that can be used when deploying applications with Cloudflare.
When using Prisma ORM with D1, you can continue to: model your database with Prisma schema language, specify `sqlite` as your database provider in your Prisma schema, and interact with your database using Prisma Client.
To use Prisma ORM and D1 on Cloudflare Workers or Cloudflare Pages, you need to set `sqlite` as your database provider and use the `@prisma/adapter-d1` database adapter via the `driverAdapters` Preview feature, released back in version [5.4.0](https://redirect.github.com/prisma/prisma/releases/tag/5.4.0).
Here is an example of sending a query to your D1 database using Prisma Client in your Worker:
```ts
// src/index.ts file
import { PrismaClient } from '@prisma/client'
import { PrismaD1 } from '@prisma/adapter-d1'
// Add the D1Database to the Env interface
export interface Env {
// This must match the binding name defined in your wrangler.toml configuration
DB: D1Database
}
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise {
// Make sure the database name matches the binding name in wrangler.toml and Env interface
const adapter = new PrismaD1(env.DB)
// Instantiate PrismaClient using the PrismaD1 driver adapter
const prisma = new PrismaClient({ adapter })
const users = await prisma.user.findMany()
const result = JSON.stringify(users)
return new Response(result)
},
}
```
📚 **Documentation:** [Deploying a Cloudflare worker with D1 and Prisma ORM](https://prisma.io/docs/orm/overview/databases/cloudflare-d1#how-to-connect-to-d1-in-cloudflare-workers-or-cloudflare-pages)
✍️ **Blog post:** [Build Applications at the Edge with Prisma ORM & Cloudflare D1 (Preview)](https://www.prisma.io/blog/build-applications-at-the-edge-with-prisma-orm-and-cloudflare-d1-preview)
📣 **Share your feedback:** [D1 Driver Adapter](https://redirect.github.com/prisma/prisma/discussions/23646)
🚀 **Example project:** [Deploy a Cloudflare Worker with D1](https://redirect.github.com/prisma/prisma-examples/tree/latest/deployment-platforms/edge/cloudflare-workers/with-d1)
##### `createMany()` for SQLite
Bringing support for `createMany()` in SQLite has been a [long-awaited and highly requested feature](https://redirect.github.com/prisma/prisma/issues/10710) ⭐
`createMany()` is a method on Prisma Client, released back in version [2.16.0](https://redirect.github.com/prisma/prisma/releases/tag/2.16.0), that lets you insert multiple records into your database at once. This can be really useful when seeding your database or inserting bulk data.
Here is an example of using `createMany()` to create new users:
```ts
const users = await prisma.user.createMany({
data: [
{ name: 'Sonali', email: 'sonali@prisma.io' },
{ name: 'Alex', email: 'alex@prisma.io' },
{ name: 'Yewande', email: 'yewande@prisma.io' },
{ name: 'Angelina', email: 'angelina@prisma.io' },
],
})
```
Before this release, if you wanted to perform bulk inserts with SQLite, you would have most likely used `$queryRawUnsafe` to execute raw SQL queries. But now you don’t have to go through all that trouble 🙂
With SQLite, `createMany()` works exactly the same way from an API standpoint as it does with other databases except it does not support the `skipDuplicates` option. At the behavior level, SQLite will split `createMany()` entries into multiple `INSERT` queries when the model in your schema contains fields with attributes like `@default(dbgenerated())` or `@default(autoincrement())` and when the fields are not consistently provided with values across the entries.
📚**Documentation:** [`createMany()` - Prisma Client API Reference](https://www.prisma.io/docs/orm/reference/prisma-client-reference#createmany)
##### Fixes and Improvements
##### Prisma Client
- [N+1 Issue with `Decimal` data type and combining queries (batching)](https://redirect.github.com/prisma/prisma/issues/5952)
- [Batched `findUnique()` error out when the field is of `Boolean` type](https://redirect.github.com/prisma/prisma/issues/22384)
- [`relationJoins` MySQL converts nested Decimal to float](https://redirect.github.com/prisma/prisma/issues/23233)
- [Unexpected query leading to querying full table when using batched `findUnique()`](https://redirect.github.com/prisma/prisma/issues/23343)
- [`node-postgres` (pg) errors with misleading `P2010 PrismaClientKnownRequestError` when using `@prisma/adapter-pg` with SSL (`?sslmode=require`)](https://redirect.github.com/prisma/prisma/issues/23390)
- [D1 DateTime type does not work](https://redirect.github.com/prisma/prisma/issues/23479)
##### Credits
Huge thanks to [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh), [@anuraaga](https://redirect.github.com/anuraaga), [@onichandame](https://redirect.github.com/onichandame), [@LucianBuzzo](https://redirect.github.com/LucianBuzzo), [@RobertCraigie](https://redirect.github.com/RobertCraigie), [@arthurfiorette](https://redirect.github.com/arthurfiorette), [@elithrar](https://redirect.github.com/elithrar) for helping!
### [`v5.11.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.11.0)
[Compare Source](https://redirect.github.com/prisma/prisma/compare/5.10.2...5.11.0)
Today, we are excited to share the `5.11.0` stable release 🎉
🌟 **Help us spread the word about Prisma by starring the repo ☝️ or [posting on X](https://twitter.com/intent/post?text=Check%20out%20the%20latest%20%40prisma%20release%20v5.11.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps%3A%2F%2Fgithub.com%2Fprisma%2Fprisma%2Freleases%2Ftag%2F5.11.0) about the release.**
##### Highlights
##### Edge function support for Cloudflare and Vercel (Preview)
We’re thrilled to announce that support for edge function deployments with Prisma ORM is now in Preview 🥳 As of this release, you can deploy your apps that are using Prisma ORM to:
- Vercel Edge Functions and Vercel Edge Middleware
- Cloudflare Workers and Cloudflare Pages
In order to deploy to an edge function, you’ll need to use a compatible database driver (along with its [Prisma driver adapter](https://www.prisma.io/docs/orm/overview/databases/database-drivers#driver-adapters)):
- Neon Serverless Driver (for PostgreSQL databases hosted via [Neon](https://neon.tech/))
- PlanetScale Serverless Driver (for MySQL databases hosted via [PlanetScale](https://planetscale.com/)
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 this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
1.3.2
->5.22.0
Release Notes
prisma/prisma (prisma)
### [`v5.22.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.22.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.21.1...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.22.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.22.0) 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](https://redirect.github.com/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 - [removing `@unique` in `schema.prisma` does not generate SQL to do so](https://redirect.github.com/prisma/prisma/issues/12732) ##### Prisma - [Prisma generate randomly fails on Ubuntu due to missing internal .so `libquery_engine-debian-openssl-1.1.x.so.node`](https://redirect.github.com/prisma/prisma/issues/19124) - [Timed out fetching a new connection from the connection pool. ](https://redirect.github.com/prisma/prisma/issues/25162) ##### Credits Huge thanks to [@tmm1](https://redirect.github.com/tmm1), [@Takur0](https://redirect.github.com/Takur0), [@hinaloe](https://redirect.github.com/hinaloe), [@andyjy](https://redirect.github.com/andyjy), and [@youxq](https://redirect.github.com/youxq) for helping! ### [`v5.21.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.21.1) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.21.0...5.21.1) - Fixed a bug where migrations were not using shadow database correctly in some edge cases ### [`v5.21.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.21.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.20.0...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.21.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.21.0) 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](https://www.prisma.io/docs/orm/prisma-client/observability-and-logging/opentelemetry-tracing). 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](https://pris.ly/gh/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](https://www.prisma.io/docs/orm/overview/databases/database-drivers#driver-adapters), going over the 1 MB limit on the free tier of Cloudflare Workers. This has now been fixed. ##### Fixes and improvements ##### Prisma Engines - [Avoid regex crate for wasm bundle size (to keep cloudflare free plan)](https://redirect.github.com/prisma/prisma-engines/issues/5008) ##### Credits Huge thanks to [@austin-tildei](https://redirect.github.com/austin-tildei), [@LucianBuzzo](https://redirect.github.com/LucianBuzzo), [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh) for helping! ### [`v5.20.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.20.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.19.1...5.20.0) 🌟 **Help us spread the word about Prisma by starring the repo or [posting on X](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.20.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.20.0) 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](https://redirect.github.com/prisma/prisma/issues/20169) and follows [our latest proposal](https://redirect.github.com/prisma/prisma/issues/20169#issuecomment-2338360300) on the same issue. To demonstrate the change, take the following code snippet: ```tsx 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: ```tsx 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. ```tsx 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](https://redirect.github.com/prisma/prisma/discussions/25271). ##### `typedSql` bug fix Thank you to everyone who has tried out our [`typedSql` Preview feature](https://www.prisma.io/blog/announcing-typedsql-make-your-raw-sql-queries-type-safe-with-prisma-orm) and [provided feedback](https://redirect.github.com/prisma/prisma/discussions/25106)! 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`.](https://redirect.github.com/prisma/prisma/issues/24072) - [Invalid TypeScript files created by `generate` when typedSql is enabled and enum contains hyphens.](https://redirect.github.com/prisma/prisma/issues/25163) - [`@prisma/internals` didn't list `ts-toolbelt` in dependencies.](https://redirect.github.com/prisma/prisma/issues/17952) - [using `$extends` prevents model comments from being passed to TypeScript](https://redirect.github.com/prisma/prisma/issues/24648) ##### Prisma Engines - [Planetscale engine tests: interactive_tx](https://redirect.github.com/prisma/prisma-engines/issues/4469) - [Fix broken engine size publishing workflow](https://redirect.github.com/prisma/prisma-engines/issues/4991) ##### Credits Huge thanks to [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@thijmenjk](https://redirect.github.com/thijmenjk), [@mydea](https://redirect.github.com/mydea), [@HRM](https://redirect.github.com/HRM), [@haaawk](https://redirect.github.com/haaawk), [@baileywickham](https://redirect.github.com/baileywickham), [@brian-dlee](https://redirect.github.com/brian-dlee), [@nickcarnival](https://redirect.github.com/nickcarnival), [@eruditmorina](https://redirect.github.com/eruditmorina), [@nzakas](https://redirect.github.com/nzakas), and [@gutyerrez](https://redirect.github.com/gutyerrez) for helping! ### [`v5.19.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.19.1) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.19.0...5.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://redirect.github.com/prisma/prisma/issues/25103) - [https://github.com/prisma/prisma/issues/25137](https://redirect.github.com/prisma/prisma/issues/25137) - [https://github.com/prisma/prisma/issues/25104](https://redirect.github.com/prisma/prisma/issues/25104) - [https://github.com/prisma/prisma/issues/25101](https://redirect.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`](https://redirect.github.com/prisma/prisma/releases/tag/5.19.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.18.0...5.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](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.19.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.19.0) 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: 1. Make sure that you have the latest version of `prisma` and `@prisma/client` installed: npm install -D prisma@latest npm install @prisma/client@latest 2. Enable the `typedSql` Preview feature in your Prisma Schema. generator client { provider = "prisma-client-js" previewFeatures = ["typedSql"] } 3. Create a `sql` subdirectory of your `prisma` directory. mkdir -p prisma/sql 4. You can now add `.sql` files to the `sql` directory! Each file can contain one sql query and the name must be a valid JS identifier. For this example, say you had the file `getUsersWithPosts.sql` with the following contents: ```sql 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 ``` 5. Import your SQL query into your code with the `@prisma/client/sql` import: ```tsx 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](https://pris.ly/typedsql-blog). For docs, check out our new [TypedSQL section](https://pris.ly/d/typedsql). ##### 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](https://redirect.github.com/prisma/prisma-engines/pull/4970) and [https://github.com/prisma/prisma/pull/24922](https://redirect.github.com/prisma/prisma/pull/24922) - Mathematic operations such as `max`, `min`, `eq`, etc in queries when using Cloudflare D1. - Resolved issues when comparing `BigInt` IDs when `relationMode="prisma"` was enabled and Cloudflare D1 was being used. ##### Joins - [https://github.com/prisma/prisma/issues/23742](https://redirect.github.com/prisma/prisma/issues/23742) fixes Prisma Client not supporting deeply nested `some` clauses when the `relationJoins` Preview 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)](https://boards.greenhouse.io/prisma/jobs/5350820002): 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)](https://boards.greenhouse.io/prisma/jobs/6940273002): This person will be focused on the `prisma-engines` Rust codebase. TypeScript knowledge (or, again, a desire to learn) is a plus. ##### Credits Huge thanks to [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@Druue](https://redirect.github.com/Druue), [@key-moon](https://redirect.github.com/key-moon), [@Jolg42](https://redirect.github.com/Jolg42), [@pranayat](https://redirect.github.com/pranayat), [@ospfranco](https://redirect.github.com/ospfranco), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh) for helping! ### [`v5.18.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.18.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.17.0...5.18.0) 🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.18.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.18.0) 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. ```tsx 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`](https://redirect.github.com/prisma/prisma/issues/24779). - [Empty `Json[]` fields will now return `[]` instead of `null` when accessed through a join using the `relationJoins` Preview feature.](https://redirect.github.com/prisma/prisma/issues/22923) ##### Fixes and improvements ##### Prisma - [Support UUID v7](https://redirect.github.com/prisma/prisma/issues/24079) ##### Language tools (e.g. VS Code) - [Support fetching references for a model](https://redirect.github.com/prisma/language-tools/issues/982) ##### Credits Huge thanks to [@mcuelenaere](https://redirect.github.com/mcuelenaere), [@pagewang0](https://redirect.github.com/pagewang0), [@Druue](https://redirect.github.com/Druue), [@key-moon](https://redirect.github.com/key-moon), [@Jolg42](https://redirect.github.com/Jolg42), [@pranayat](https://redirect.github.com/pranayat), [@ospfranco](https://redirect.github.com/ospfranco), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh), [@haaawk](https://redirect.github.com/haaawk) for helping! ### [`v5.17.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.17.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.16.2...5.17.0) 🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.17.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.17.0) 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 ![references](https://redirect.github.com/user-attachments/assets/b7d82584-2be7-4db6-bfd9-4dbe46f9e865) **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. ![image](https://redirect.github.com/user-attachments/assets/b0dbc818-374b-4b6d-bda5-974d66efca65) **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. ![image (1)](https://redirect.github.com/user-attachments/assets/931e8dff-2b1e-4da7-bd17-5b844d12804e) ##### 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 - [Remove or change `This is the 10th instance of Prisma Client being started. Make sure this is intentional.` warning](https://redirect.github.com/prisma/prisma/issues/23736) ##### Prisma - [Prisma generate option --allow-no-models doesn't work.](https://redirect.github.com/prisma/prisma/issues/24737) ##### Language tools (e.g. VS Code) - [LSP Rename incorrectly maps field name and appends character](https://redirect.github.com/prisma/language-tools/issues/1771) ##### Credits Huge thanks to [@key-moon](https://redirect.github.com/key-moon), [@pranayat](https://redirect.github.com/pranayat), [@yubrot](https://redirect.github.com/yubrot), [@skyzh](https://redirect.github.com/skyzh) for helping! ### [`v5.16.2`](https://redirect.github.com/prisma/prisma/releases/tag/5.16.2) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.16.1...5.16.2) Today, we are issuing the 5.16.2 patch release to fix an issue in Prisma client. #### Fix in Prisma Client - [nextjs app deployed to vercel edge can't import prisma WASM modul ](https://redirect.github.com/prisma/prisma/issues/24673) ### [`v5.16.1`](https://redirect.github.com/prisma/prisma/releases/tag/5.16.1) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.16.0...5.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 ](https://redirect.github.com/prisma/prisma/issues/24634) - [Prisma Seed Script Fails After Upgrading to v5.16.0 (DATABASE_URL Error)](https://redirect.github.com/prisma/prisma/issues/24658) ### [`v5.16.0`](https://redirect.github.com/prisma/prisma/releases/tag/5.16.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/5.15.1...5.16.0) 🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.16.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.16.0) 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. ```tsx 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 ```tsx 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 ```tsx 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](https://redirect.github.com/prisma/prisma/discussions/24413) 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 `prismaSchemaFolder` feature, a path is now relative to the file it is defined in rather than relative to the `prisma/schema` folder. This means that if you have a generator block in `/project/prisma/schema/config/generator.prisma` with an `output` of `./foo` the output will be resolved to `/project/prisma/schema/config/foo` rather 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/schema` as well as `prisma/schema.prisma`. Our initial implementation looked for a `.prisma` file first and would ignore the `schema` folder 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 `Expand to view the example Prisma schema
```prisma 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 } ```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 this update again.
This PR was generated by Mend Renovate. View the repository job log.