criticic / cums-technex

0 stars 0 forks source link

Update dependency @prisma/client to v5.17.0 #4

Open renovate[bot] opened 3 months ago

renovate[bot] commented 3 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@prisma/client (source) 5.11.0 -> 5.17.0 age adoption passing confidence

Release Notes

prisma/prisma (@​prisma/client) ### [`v5.17.0`](https://togithub.com/prisma/prisma/releases/tag/5.17.0) [Compare Source](https://togithub.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://togithub.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://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/23736) ##### Prisma - [Prisma generate option --allow-no-models doesn't work.](https://togithub.com/prisma/prisma/issues/24737) ##### Language tools (e.g. VS Code) - [LSP Rename incorrectly maps field name and appends character](https://togithub.com/prisma/language-tools/issues/1771) ##### Credits Huge thanks to [@​key-moon](https://togithub.com/key-moon), [@​pranayat](https://togithub.com/pranayat), [@​yubrot](https://togithub.com/yubrot), [@​skyzh](https://togithub.com/skyzh) for helping! ### [`v5.16.2`](https://togithub.com/prisma/prisma/releases/tag/5.16.2) [Compare Source](https://togithub.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://togithub.com/prisma/prisma/issues/24673) ### [`v5.16.1`](https://togithub.com/prisma/prisma/releases/tag/5.16.1) [Compare Source](https://togithub.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://togithub.com/prisma/prisma/issues/24634) - [Prisma Seed Script Fails After Upgrading to v5.16.0 (DATABASE_URL Error)](https://togithub.com/prisma/prisma/issues/24658) ### [`v5.16.0`](https://togithub.com/prisma/prisma/releases/tag/5.16.0) [Compare Source](https://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/17565) - [`Prisma has no exported member named OrderByWithRelationInput. Did you mean OrderByWithAggregationInput?`](https://togithub.com/prisma/prisma/issues/21017) - [\[Driver Adapters\]: missing provider compatibility validation](https://togithub.com/prisma/prisma/issues/21864) - [Disable "Start using Prisma Client" hint logs on `prisma generate`](https://togithub.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://togithub.com/prisma/prisma/issues/23500) - [`@prisma/adapter-pg` modifies node-postgres global type parsers](https://togithub.com/prisma/prisma/issues/23505) - [@​prisma/adapter-d1 is failing with an import error when called inside vitest tests](https://togithub.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://togithub.com/prisma/prisma/issues/24268) ##### Language tools (e.g. VS Code) - [Make prisma-fmt logs to work with language server](https://togithub.com/prisma/language-tools/issues/1193) - [Spans and positions get shifted out of sync when schema includes multibyte characters](https://togithub.com/prisma/language-tools/issues/1308) - [VSCode extension panics when opening an empty prisma schema](https://togithub.com/prisma/language-tools/issues/1760) ##### Prisma Engines - [\[DA\]Ā Planetscale engine tests: one2m_mix_required_writable_readable](https://togithub.com/prisma/prisma-engines/issues/4482) - [\[DA\]Ā Planetscale engine tests: apply_number_ops](https://togithub.com/prisma/prisma-engines/issues/4485) ##### Credits Huge thanks to [@​key-moon](https://togithub.com/key-moon), [@​pranayat](https://togithub.com/pranayat), [@​yubrot](https://togithub.com/yubrot), [@​skyzh](https://togithub.com/skyzh), [@​brian-dlee](https://togithub.com/brian-dlee), [@​mydea](https://togithub.com/mydea), [@​nickcarnival](https://togithub.com/nickcarnival), [@​eruditmorina](https://togithub.com/eruditmorina), [@​nzakas](https://togithub.com/nzakas), [@​gutyerrez](https://togithub.com/gutyerrez), [@​avallete](https://togithub.com/avallete), [@​ceddy4395](https://togithub.com/ceddy4395), [@​Kayoshi-dev](https://togithub.com/Kayoshi-dev), [@​yehonatanz](https://togithub.com/yehonatanz) for helping! ### [`v5.15.1`](https://togithub.com/prisma/prisma/releases/tag/5.15.1) [Compare Source](https://togithub.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://togithub.com/prisma/prisma/issues/23407) - [Got error 'internal error: entered unreachable code' when trying to perform an upsert.](https://togithub.com/prisma/prisma/issues/22947) - [Prisma Client errors on SQLite with internal error: entered unreachable code when running 2 concurrent upsert ](https://togithub.com/prisma/prisma/issues/22725) - [`ConnectionError(Timed out during query execution.)` during seeding](https://togithub.com/prisma/prisma/issues/21772) - [SQLite timeouts after upgrade from prisma 2 to prisma 4](https://togithub.com/prisma/prisma/issues/17029) - [`ConnectionError(Timed out during query execution.)` error when using `Promise.all` for SQLite](https://togithub.com/prisma/prisma/issues/11789) - [Improve the error when SQLite database file is locked](https://togithub.com/prisma/prisma/issues/10403) - [sqlite timeout error multiple queries run one after another](https://togithub.com/prisma/prisma/issues/10306) - [SQLite times out during query execution when using `Promise.all()` / concurrent](https://togithub.com/prisma/prisma/issues/9562) - [internal error: entered unreachable code](https://togithub.com/prisma/prisma/issues/24511) ### [`v5.15.0`](https://togithub.com/prisma/prisma/releases/tag/5.15.0) [Compare Source](https://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/11010) - [Crash introspecting MSSQL database with `DEFAULT`s](https://togithub.com/prisma/prisma/issues/11557) - [doing introspection on a SQL Server 2018 DB - for Dynamic GP get the following error.](https://togithub.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://togithub.com/prisma/prisma/issues/15704) - [Error: called `Result::unwrap()` on an `Err` value: "Couldn't parse default value in SQL Server](https://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/17292) - [Error when pulling from database](https://togithub.com/prisma/prisma/issues/19971) - [Foreign key relation results in erroneous second migration](https://togithub.com/prisma/prisma/issues/23043) - [`db pull` can't parse script setting default value](https://togithub.com/prisma/prisma/issues/23453) - [Bug: Migrations not compatible with D1](https://togithub.com/prisma/prisma/issues/24208) - [SQL Server Introspection crashes on multi-line (deprecated) defaults](https://togithub.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://togithub.com/prisma/prisma/issues/16611) - [Float number on raw query: `incorrect binary data format in bind parameter 1`](https://togithub.com/prisma/prisma/issues/17110) - [Can't use Prisma client in Next.js middleware, even when deploying to Node.js](https://togithub.com/prisma/prisma/issues/21310) - [Prepared statement caching is data dependent on numeric input parameters (`incorrect binary data format in bind parameter x`)](https://togithub.com/prisma/prisma/issues/22482) - [Turso Driver Adapter: Including `_count` leads to error](https://togithub.com/prisma/prisma/issues/23566) - [Next.js app build fails when using Prisma with DB driver in Server Action](https://togithub.com/prisma/prisma/issues/23600) - [Bug: \[D1\] Error in performIO: Error: D1\_ERROR: too many SQL variables](https://togithub.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://togithub.com/prisma/prisma/issues/23763) - [$executeRawUnsafe: `incorrect binary data format in bind parameter 6`](https://togithub.com/prisma/prisma/issues/23872) - [Bug: Error or bug using Prisma with DriverAdapter with PostgreSQL database Neon](https://togithub.com/prisma/prisma/issues/23903) - [`Inconsistent column data: Unexpected conversion failure from Number to BigInt` error when using `@prisma/adapter-pg` ](https://togithub.com/prisma/prisma/issues/23926) - [Incompatibility with NextJS app dir, CloudFlare Pages and D1](https://togithub.com/prisma/prisma/issues/23929) - [Breaking change? `Int` switched to being `Int32` for MongoDB](https://togithub.com/prisma/prisma/issues/24262) ##### Language tools (e.g. VS Code) - [VS Code extension is showing an advertisement](https://togithub.com/prisma/language-tools/issues/1732) - [`Generate` codelens fails on Windows](https://togithub.com/prisma/language-tools/issues/1738) - [We incorrectly read commented out preview features if they are before the real preview features](https://togithub.com/prisma/language-tools/issues/1741) ##### Credits Huge thanks to [@​pranayat](https://togithub.com/pranayat), [@​yubrot](https://togithub.com/yubrot), and [@​skyzh](https://togithub.com/skyzh) for helping! ### [`v5.14.0`](https://togithub.com/prisma/prisma/releases/tag/5.14.0) [Compare Source](https://togithub.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://togithub.com/prisma/prisma/issues/8131) - [Generating Prisma client without any model in its schema](https://togithub.com/prisma/prisma/issues/11582) - [MongoDB: Performance issue with nested `take` on many-to-one relationship](https://togithub.com/prisma/prisma/issues/13865) - [Slow queries on MongoDB using `include` for relations](https://togithub.com/prisma/prisma/issues/15156) - [\[MongoDB\] Performance issue in `findMany()` query execution with `in`](https://togithub.com/prisma/prisma/issues/15983) - [MongoDB nested/`include` query slow](https://togithub.com/prisma/prisma/issues/17142) - [MongoDB Connector generates queries which do not take advantage of indices.](https://togithub.com/prisma/prisma/issues/17396) - [Mongodb Nested Queries Not Using Indexes](https://togithub.com/prisma/prisma/issues/18025) - [MongoDB slow delete with `onDelete: SetNull`](https://togithub.com/prisma/prisma/issues/19169) - [Slow query with many-to-one relationship on MongoDB](https://togithub.com/prisma/prisma/issues/20600) - [`prisma init --with-model`](https://togithub.com/prisma/prisma/issues/20915) - [Fixed version of `@opentelemetry/*` dependencies](https://togithub.com/prisma/prisma/issues/21473) - [Usage of deprecated punycode module](https://togithub.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://togithub.com/prisma/prisma/issues/23902) ##### Prisma Migrate - [Empty `dbgenerated()` still breaking for `Unsupported()` types](https://togithub.com/prisma/prisma/issues/15654) - [Validation error when `shadowDatabaseUrl` is identical to `url` (or `directUrl`)](https://togithub.com/prisma/prisma/issues/16628) - [MongoDB Query with 'in' condition will cause COLLSCAN, without leveraging indexes](https://togithub.com/prisma/prisma/issues/19955) - ["Not Authorised" when directly applying Prisma generated migrations to Cloudflare D1 with `PRAGMA foreign_key_check;`](https://togithub.com/prisma/prisma/issues/23827) ##### Language tools (e.g. VS Code) - [make superior: model generate](https://togithub.com/prisma/language-tools/issues/1651) - [Missing code autocomplete for referential actions with mongodb](https://togithub.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://togithub.com/pranayat), [@​yubrot](https://togithub.com/yubrot), [@​skyzh](https://togithub.com/skyzh), [@​anuraaga](https://togithub.com/anuraaga), [@​gutyerrez](https://togithub.com/gutyerrez), [@​avallete](https://togithub.com/avallete), [@​ceddy4395](https://togithub.com/ceddy4395), [@​Kayoshi-dev](https://togithub.com/Kayoshi-dev) for helping! ### [`v5.13.0`](https://togithub.com/prisma/prisma/releases/tag/5.13.0) [Compare Source](https://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/5042). **šŸ“£Ā Share your feedback:** [`omitApi` Preview feature](https://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/23702) ##### Credits Huge thanks to [@​ospfranco](https://togithub.com/ospfranco), [@​pranayat](https://togithub.com/pranayat), [@​yubrot](https://togithub.com/yubrot), [@​skyzh](https://togithub.com/skyzh), [@​anuraaga](https://togithub.com/anuraaga), [@​yehonatanz](https://togithub.com/yehonatanz), [@​arthurfiorette](https://togithub.com/arthurfiorette), [@​elithrar](https://togithub.com/elithrar), [@​tockn](https://togithub.com/tockn), [@​Kuhave](https://togithub.com/Kuhave), [@​obiwac](https://togithub.com/obiwac) for helping! ### [`v5.12.1`](https://togithub.com/prisma/prisma/releases/tag/5.12.1) [Compare Source](https://togithub.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://togithub.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://togithub.com/prisma/prisma/issues/17558)8) ### [`v5.12.0`](https://togithub.com/prisma/prisma/releases/tag/5.12.0) [Compare Source](https://togithub.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://togithub.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://togithub.com/prisma/prisma/discussions/23646) šŸš€Ā **Example project:** [Deploy a Cloudflare Worker with D1](https://togithub.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://togithub.com/prisma/prisma/issues/10710) ā­ `createMany()` is a method on Prisma Client, released back in version [2.16.0](https://togithub.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://togithub.com/prisma/prisma/issues/5952) - [Batched `findUnique()` error out when the field is of `Boolean` type](https://togithub.com/prisma/prisma/issues/22384) - [`relationJoins` MySQL converts nested Decimal to float](https://togithub.com/prisma/prisma/issues/23233) - [Unexpected query leading to querying full table when using batched `findUnique()`](https://togithub.com/prisma/prisma/issues/23343) - [`node-postgres` (pg) errors with misleading `P2010 PrismaClientKnownRequestError` when using `@prisma/adapter-pg` with SSL (`?sslmode=require`)](https://togithub.com/prisma/prisma/issues/23390) - [D1 DateTime type does not work](https://togithub.com/prisma/prisma/issues/23479) #### Credits Huge thanks to [@​yubrot](https://togithub.com/yubrot), [@​skyzh](https://togithub.com/skyzh), [@​anuraaga](https://togithub.com/anuraaga), [@​onichandame](https://togithub.com/onichandame), [@​LucianBuzzo](https://togithub.com/LucianBuzzo), [@​RobertCraigie](https://togithub.com/RobertCraigie), [@​arthurfiorette](https://togithub.com/arthurfiorette), [@​elithrar](https://togithub.com/elithrar) for helping!

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 has been generated by Mend Renovate. View repository job log here.