diego3g / umbriel

✉️ Umbriel is a simple mailing platform built with Node.js, TypeScript & Prisma.
MIT License
518 stars 73 forks source link

fix(deps): update prisma monorepo to v3.15.2 #152

Open renovate[bot] opened 2 years ago

renovate[bot] commented 2 years ago

This PR contains the following updates:

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

Release Notes

prisma/prisma (@​prisma/client) ### [`v3.15.2`](https://togithub.com/prisma/prisma/releases/tag/3.15.2) [Compare Source](https://togithub.com/prisma/prisma/compare/3.15.1...3.15.2) Today, we are issuing the `3.15.2` patch release. ##### Fixes In order to use the [Prisma Data Proxy](https://www.prisma.io/docs/concepts/data-platform/data-proxy) via Prisma Client, you need to generate it with `prisma generate --data-proxy` as described in our [documentation](https://prisma.io/docs/concepts/data-platform/data-proxy#step-4-generate-the-client). We are introducing `PRISMA_GENERATE_DATAPROXY="true"` as an additional way to do the same thing, but [via an environment variable](https://prisma.io/docs/reference/api-reference/environment-variables-reference#prisma_generate_dataproxy). This is necessary, for example, to reliably deploy a Prisma Client for Data Proxy on Vercel Serverless Functions, where it can be hard to update the build command to run `prisma generate --data-proxy`. Starting with this version you can just set `PRISMA_GENERATE_DATAPROXY="true"` as an environment variable the Vercel project settings. If you are unfamiliar with the Data Proxy, read [how to get started](https://www.prisma.io/docs/concepts/data-platform/data-proxy). ### [`v3.15.1`](https://togithub.com/prisma/prisma/releases/tag/3.15.1) [Compare Source](https://togithub.com/prisma/prisma/compare/3.15.0...3.15.1) Today, we are issuing the `3.15.1` patch release. ##### Fixes - [Regression: Prisma 3.15.0 with macOS / Azure SQL Server errors at database connection](https://togithub.com/prisma/prisma/issues/13673) ### [`v3.15.0`](https://togithub.com/prisma/prisma/releases/tag/3.15.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.14.0...3.15.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%20v3.15.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.15.0) about the release.** 🌟 ##### Major improvements ##### Improvements to Prisma Client for Data Proxy In this release, we're shipping a couple of improvements to Prisma Client for Data Proxy. The [Prisma Data Proxy](https://www.prisma.io/docs/concepts/data-platform/data-proxy) provides connection management and pooling for database connections for efficiently scaling database connections in serverless environments. The Prisma Client for Data Proxy provides support for connecting to the Prisma Data Proxy using HTTP. We introduced this feature in version [`3.3.0`](https://togithub.com/prisma/prisma/releases/tag/3.3.0) and constantly shipped features, fixes, and improvements. One of the changes in this release is improving the Prisma Client for the Data Proxy generation step. ```diff datasource db { provider = "postgresql" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" - previewFeatures = ["dataProxy"] } ``` You can generate Prisma Client for the Data Proxy it by using the `--data-proxy` flag: ```bash npx prisma generate --data-proxy ``` We also updated how you can run Prisma Client using the Data Proxy in [Cloudflare Workers and Edge](https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers) environments. You can now use `@prisma/client/edge` instead of `@prisma/client` in your application. ```ts import { PrismaClient } from '@​prisma/client/edge' ``` To learn more, check out our [documentation](https://www.prisma.io/docs/concepts/data-platform/data-proxy). ##### Prisma Client Metrics is now in Preview Metrics is a new Preview feature that allows you to monitor how Prisma Client interacts with your database. Metrics expose a set of counters, gauges, and histograms that can be labeled and piped into an external monitoring system like [Prometheus](https://prometheus.io/) or [StatsD](https://togithub.com/statsd/statsd). You can use metrics in your project to help diagnose how your application's number of idle and active connections changes with counters, gauges, and histograms. To get started using metrics in your project, enable the Preview feature flag in your Prisma schema: ```prisma generator client { provider = "prisma-client-js" previewFeatures = ["metrics"] } ``` You can then get started using metrics in your project: ```ts import { PrismaClient } from '@​prisma/client' const prisma = new PrismaClient() const metrics = await prisma.$metrics.json() console.log(metrics) ``` To learn more, check out the metrics [documentation](https://www.prisma.io/docs/guides/performance-and-optimization/metrics). Give it a try and [let us know what you think](https://togithub.com/prisma/prisma/issues/13579). ##### Regression ##### Azure SQL on MacOS This release includes a known regression when connecting to Azure SQL from MacOS only and will be resolved soon. Follow [this issue for updates and resolution](https://togithub.com/prisma/prisma/issues/13673). ##### Fixes and improvements ##### `migrate reset` returns with a non-0 exit code if the seed script returns with a non-0 exit code This will help user scripts know more about the success of the command, but might break existing scripts. ##### Prisma - [Schema validation does not accept absolute Windows style paths for SQLite database](https://togithub.com/prisma/prisma/issues/6472) - [`introspect --url` throws error if existing schema file only contains `generator`](https://togithub.com/prisma/prisma/issues/8317) - [`prisma migrate reset` always exits with `0`, needs to exit with `1` on errors](https://togithub.com/prisma/prisma/issues/9786) - [Error: Error in migration engine. Reason: \[migration-engine/connectors/sql-migration-connector/src/sql_schema_differ/differ_database.rs:111:9\] no entry found for key ](https://togithub.com/prisma/prisma/issues/10557) - [Error: Error in migration engine. Reason: \[migration-engine/connectors/sql-migration-connector/src/sql_schema_differ/differ_database.rs:111:9\] no entry found for key ](https://togithub.com/prisma/prisma/issues/10558) - [Error: Error in migration engine. Reason: \[migration-engine/connectors/sql-migration-connector/src/sql_schema_differ/differ_database.rs:111:9\] no entry found for key ](https://togithub.com/prisma/prisma/issues/11011) - [`Would you like to create a Github issue? » Yes` does nothing in terminal on Windows](https://togithub.com/prisma/prisma/issues/11373) - [Error: \[/rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/str/mod.rs:580:13\] byte index 59 is not a char boundary; it is inside '....' (bytes 57..60) of `患者ID` ](https://togithub.com/prisma/prisma/issues/11456) - [Schema Parsing/Validation error should include CLI version](https://togithub.com/prisma/prisma/issues/11908) - [Prisma panic on invalid int](https://togithub.com/prisma/prisma/issues/12526) - [Error: \[/rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/str/mod.rs:584:13\] byte index 47 is not a char boundary; it is inside '点' (bytes 46..49) of `AirbyteRawYuriPagesAirbyteDataProperties推荐点RichText` ](https://togithub.com/prisma/prisma/issues/12727) - [Introspection: Make SQL in tests more advanced so that Introspection results will include native types, not just scalar types](https://togithub.com/prisma/prisma/issues/13180) - [Add more integration tests for CockroachDB for `db` and `migrate` commands](https://togithub.com/prisma/prisma/issues/13268) - [MongoDB - prisma db pull](https://togithub.com/prisma/prisma/issues/13294) - [Multi-byte character truncation bug in mongo introspection connector](https://togithub.com/prisma/prisma/issues/13351) - [MSSQL Docker Run Migration "The Trust Settings Record was corrupted"](https://togithub.com/prisma/prisma/issues/13371) - [Running DB Pull on Remote MSSQL database](https://togithub.com/prisma/prisma/issues/13372) - [Error: Error in migration engine. Reason: \[libs/sql-schema-describer/src/postgres.rs:1039:28\] no entry found for key ](https://togithub.com/prisma/prisma/issues/13520) - [Error: \[libs\sql-schema-describer\src\postgres.rs:1039:28\] no entry found for key ](https://togithub.com/prisma/prisma/issues/13521) - [prisma migrate deploy error](https://togithub.com/prisma/prisma/issues/13603) ##### Prisma Client - [Support Bytes on SQLite](https://togithub.com/prisma/prisma/issues/6666) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/9896) - [Huge Int value in `upsert` causes: "PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87"](https://togithub.com/prisma/prisma/issues/10049) - [Data Proxy Client should't need to be re-generated after modifying `.env` files](https://togithub.com/prisma/prisma/issues/10187) - [Data Proxy Client stopped working in Vercel Edge Functions / Next 12.0.4](https://togithub.com/prisma/prisma/issues/10305) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine\core\src\query_document\parser.rs:250:87](https://togithub.com/prisma/prisma/issues/10586) - [Data Proxy: `prisma generate` errors with `Error: Error: ENOENT: no such file or directory, open '/[...]/prisma/schema.prisma'` when using a custom name for the Prisma schema file](https://togithub.com/prisma/prisma/issues/10936) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/11263) - [DATABASE_URL is baked in Dataproxy client proxy.js ](https://togithub.com/prisma/prisma/issues/11458) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/11467) - [Can't save string to Decimals list](https://togithub.com/prisma/prisma/issues/11674) - [Sveltekit + Cloudflare adapter - "PrismaClient is unable to be run in the browser."](https://togithub.com/prisma/prisma/issues/11712) - [`TypeError: at normalizeAndValidateHeaderValue` with data proxy in cloudflare workers/miniflare](https://togithub.com/prisma/prisma/issues/12356) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/12491) - [Implement "CLI engine crash reporting" for Formatter Engine and `getConfig` and `getDmmf` of Query Engine](https://togithub.com/prisma/prisma/issues/12495) - [Add test for internal engine port](https://togithub.com/prisma/prisma/issues/12507) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/12654) - [DataProxy Client only works if I instantiate a normal Client first](https://togithub.com/prisma/prisma/issues/12682) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/12737) - [Engine hard crashes on id values exceeding the Number.MAX_SAFE_INTEGER](https://togithub.com/prisma/prisma/issues/12841) - [dbgenerated function cause Null constraint error in MySQL](https://togithub.com/prisma/prisma/issues/12850) - [Expose Metrics in Prisma Client](https://togithub.com/prisma/prisma/issues/12875) - [Improve the DX for enabling the data proxy](https://togithub.com/prisma/prisma/issues/12904) - [Client crash on out-of-range integer update using Postgres](https://togithub.com/prisma/prisma/issues/12969) - [Prisma Client has stopped working on Vercel Edge Functions](https://togithub.com/prisma/prisma/issues/13059) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/core/src/query_document/parser.rs:250:87](https://togithub.com/prisma/prisma/issues/13293) - [`InvalidDatasourceError` of Data Proxy Client outputs a code snippet](https://togithub.com/prisma/prisma/issues/13337) - [A few small typos in the repo (unkown)](https://togithub.com/prisma/prisma/issues/13394) - [Cloudflare Workers with PlanetScale db](https://togithub.com/prisma/prisma/issues/13474) ##### Credits Huge thanks to [@​shian15810](https://togithub.com/shian15810), [@​zifeo](https://togithub.com/zifeo), [@​ever0de](https://togithub.com/ever0de), [@​rushabhhere](https://togithub.com/rushabhhere) for helping! ##### Prisma Day [Prisma Day](https://prisma.io/day) is back this year, and it'll be on June 15 - 16 at the James June Sommergarten in Berlin. Join us in-person or online for talks and workshops on modern application development and databases. Come and meet and chat with the team behind the Prisma ORM and Prisma Data Platform. ##### 💼 We're hiring! If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you. We're looking for a [Technical Support Engineer](https://grnh.se/ff0d8a702us) and [Back-end Engineer: Prisma Data Platform](https://grnh.se/45afe7982us). Feel free to read through the job descriptions and apply using the links provided. ##### 📺 Join us for another "What's new in Prisma" livestream Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/B3Mh3yGRZ5U) livestream. The stream takes place [on YouTube](https://youtu.be/B3Mh3yGRZ5U) on **Thursday, June 9** at **5 pm Berlin | 8 am San Francisco**. ### [`v3.14.0`](https://togithub.com/prisma/prisma/releases/tag/3.14.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.13.0...3.14.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%20v3.14.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.14.0) about the release.** 🌟 ##### Major improvements ##### CockroachDB connector is now Generally Available! We are proud to announce the CockroachDB connector is now stable and Generally Available. The connector was built in joined efforts with the team at [Cockroach Labs](https://www.cockroachlabs.com/) and comes with full Prisma Client and Prisma Migrate support. If you're upgrading from Prisma version `3.9.0`+ or the PostgreSQL connector, you can now run `npx prisma db pull` and review the changes to your schema. To learn more about CockroachDB-specific native types we support, refer to [our docs](http://prisma.io/docs/concepts/database-connectors/cockroachdb#type-mapping-limitations-in-cockroachdb). To learn more about the connector and how it differs from PostgreSQL, head to our [documentation](https://www.prisma.io/docs/concepts/database-connectors/cockroachdb). ##### PostgreSQL `GIN`, `GiST`, `SP-GiST`, and `BRIN` indexes support (Preview) We introduced the `extendedIndexes` Preview feature in version `3.5.0`, and we have been adding new configuration options for indexes. We've expanded index type support with the `GIN`, `GiST`, `SP-GiST`, and `BRIN` indexes in this release. To make use of an index type, you can update your Prisma schema by providing the `type` argument to the `@@​index` attribute: ```prisma datasource db { provider = "postgresql" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["extendedIndexes"] } model Post { id Int @​id title String content String? tags Json? @​@​index([tags], type: Gin) } ``` The following SQL will be generated in your migration when you run `prisma migrate dev`: ```sql CREATE TABLE "Post" ( "id" INTEGER NOT NULL, "title" TEXT NOT NULL, "content" TEXT, "tags" JSONB, CONSTRAINT "Post_pkey" PRIMARY KEY ("id") ); CREATE INDEX "Post_tags_idx" ON "Post" USING GIN ("tags"); ``` To learn more about configuring index types in your schema, refer to [our documentation](https://prisma.io/docs/concepts/components/prisma-schema/indexes#configuring-the-access-type-of-indexes-with-type-postgresql). ##### Improved `queryRaw` API In this release, we made improvements to the SQL raw API. Some improvements are breaking and will be available behind the new `improvedQueryRaw` Preview feature flag. The `improvedQueryRaw` Preview feature solves most of the issues faced when working with the raw API. We would encourage you to turn on the Preview feature flag, try out the new API, and let us know how we can make it even better. You can enable the Preview feature in your Prisma schema as follows: ```prisma datasource db { provider = "postgresql" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["improvedQueryRaw"] } ``` Here's a list of the improvements `improvedQueryRaw` comes with: ##### 1. Raw scalar values are deserialized as their correct JavaScript types Prisma Client queries such as `findMany` deserialize database scalar values to their corresponding JavaScript types. For example, a `DateTime` value is deserialized as a JavaScript `Date,` and a `Bytes` would be deserialized as a JavaScript `Buffer`. Raw queries now implement the same behavior when the `improvedQueryRaw` Preview feature flag is enabled. > ⚠️ This change is not yet available in the SQLite connector. The types of values from the database will be used instead of the types in the Prisma schema. Here's an example query and response: ```ts const res = await prisma.$queryRaw`SELECT bigint, bytes, decimal, date FROM "Table";` console.log(res) // [{ bigint: BigInt("123"), bytes: Buffer.from([1, 2]), decimal: new Prisma.Decimal("12.34"), date: Date("") }] ``` Here's a table that recaps the serialization type-mapping for raw results: | Database Type | Javascript Type | | --- | --- | | Text | String | | Int32 | Number | | Float | Number | | Double | Number | | Int64 | BigInt | | Numeric | Decimal | | Bytes | Buffer | | Json | Object | | DateTime | Date | | Date | Date | | Time | Date | | Uuid | String | | Xml | String | ##### 2. PostgreSQL type-casts We've also fixed a lot of PostgreSQL type-casts that were broken by enabling the `improvedQueryRaw` Preview feature flag. Here's an example of a query that used to fail: ```ts await prisma.$queryRaw`SELECT ${1.5}::int as int`; // Before: db error: ERROR: incorrect binary data format in bind parameter 1 // After: [{ int: 2 }] ``` You can now perform some more type-casts in your queries: ```ts await prisma.$queryRaw`SELECT ${2020}::float4, (NOW() - ${"1 day"}::interval), ${"2022-01-01 00:00:00"}::timestamptz;` ``` A consequence of this fix is that some subtle implicit casts are now handled more strictly and would fail. Here's an example that used to work but won't work anymore under the `improvedQueryRaw` feature flag: ```ts await prisma.$queryRaw`SELECT LENGTH(${42});` // ERROR: function length(integer) does not exist // HINT: No function matches the given name and argument types. You might need to add explicit type casts. ``` The `LENGTH` PostgreSQL function only accept `text` as input. Prisma used to coerce `42` to `text` silently, but won’t anymore. As suggested by the hint, cast `42` to `text` as follows: ```ts await prisma.$queryRaw`SELECT LENGTH(${42}::text);` ``` ##### 3. Query parameters are correctly sent to the database > This improvement is available without the `improvedQueryRaw` Preview feature flag. Before this release, query parameters of type `BigInt`, `Bytes`, and `Decimal` were incorrectly sent to the database leading to instances of unexpected inserts. Passing the types as query parameters now works: ```ts await prisma.$executeRaw`INSERT INTO "Table" ("bigint", "bytes", "decimal") VALUES (${BigInt("123")}, ${Buffer.from([1, 2, 3])}, ${new Prisma.Decimal("12.23")});` ``` ##### Fixes and improvements ##### Prisma Client - [Improve type conversion and responses for raw queries](https://togithub.com/prisma/prisma/issues/4569) - [Postgres parameterized interval is passed incorrectly in raw query](https://togithub.com/prisma/prisma/issues/4647) - [queryRaw cannot handle some numbers](https://togithub.com/prisma/prisma/issues/6818) - [Query raw run throws the following error `incorrect binary data format in bind parameter 3`](https://togithub.com/prisma/prisma/issues/7194) - [BigInt becomes Number if queried with `$queryRaw`](https://togithub.com/prisma/prisma/issues/7395) - [Weird behavior of raw query containing st_dwithin and radius parameter binding](https://togithub.com/prisma/prisma/issues/7799) - [`generate` output with `output` has weird package path on Windows](https://togithub.com/prisma/prisma/issues/7809) - [Casting error when using integers in raw query](https://togithub.com/prisma/prisma/issues/7839) - [$queryRaw fails when passing bigint as parameter](https://togithub.com/prisma/prisma/issues/8121) - [Decimal becomes Number if queried with $queryRaw](https://togithub.com/prisma/prisma/issues/9163) - [$queryRaw doesn't allow for typecasts](https://togithub.com/prisma/prisma/issues/9197) - [Raw sql Is not working as expected ](https://togithub.com/prisma/prisma/issues/9333) - [Missing `$` from `executeRaw` in error message "Invalid \`prisma.executeRaw()\` invocation:"](https://togithub.com/prisma/prisma/issues/9388) - [Parameterized ExecuteRaw breaks with Postgres Floats](https://togithub.com/prisma/prisma/issues/9949) - [PANIC: called `Result::unwrap()` on an `Err` value: Any { .. } in query-engine/connectors/sql-query-connector/src/error.rs:58:51](https://togithub.com/prisma/prisma/issues/10224) - [$queryRaw to Postgres failing to correctly insert/cast numeric parameters](https://togithub.com/prisma/prisma/issues/10424) - [Compound primary key is not generated when a unique field has the same name](https://togithub.com/prisma/prisma/issues/10456) - [`referentialIntegrity = prisma`: Broken query on `onUpdate: Cascade` | `symbol ... not found` | `The column ... does not exist in the current database.`](https://togithub.com/prisma/prisma/issues/10758) - [Getting a "Raw query failed. Code: `N/A`. Message: ` error deserializing column 0: a Postgres value was `NULL\`\`" error when using Postgres ARRAY_AGG with a nullable column](https://togithub.com/prisma/prisma/issues/11339) - [Planetscale not able to upsert with Prisma](https://togithub.com/prisma/prisma/issues/11469) - [connectOrCreate deletes old relation and creates a new one](https://togithub.com/prisma/prisma/issues/11731) - [referentialIntegrity=prisma causes P2022 (column not exist) on updating a record](https://togithub.com/prisma/prisma/issues/11792) - [Unable to insert Buffer into Bytes pg field using $executeRaw](https://togithub.com/prisma/prisma/issues/11834) - [CockroachDB: Figure out, test and document which versions we support](https://togithub.com/prisma/prisma/issues/12383) - [Implement `debugPanic` like functionality for `getConfig` and `getDmmf` of Query Engine](https://togithub.com/prisma/prisma/issues/12494) - [$queryRaw returning numbers for bigint fields](https://togithub.com/prisma/prisma/issues/12551) - [Prisma returns sequence values with number type from Postgres while using queryRaw](https://togithub.com/prisma/prisma/issues/12583) - [PANIC: called `Result::unwrap()` on an `Err` value: Any { .. } in query-engine/connectors/sql-query-connector/src/error.rs:58:51](https://togithub.com/prisma/prisma/issues/12641) - [RQ: Properly coerce query raw input parameters in the Query Engine](https://togithub.com/prisma/prisma/issues/12795) - [RQ: Properly coerce query raw result in the Client](https://togithub.com/prisma/prisma/issues/12796) - [RQ: Send type-hinted query parameters for raw queries (Postgres)](https://togithub.com/prisma/prisma/issues/12797) - [RQ: Integrate new QE result for query raw in the client](https://togithub.com/prisma/prisma/issues/12800) - [thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: Relation fields should never hit the BSON conversion logic.', query-engine/connectors/mongodb-query-connector/src/value.rs:34:35](https://togithub.com/prisma/prisma/issues/12929) - [Exception when using Decimal.js instance in an input](https://togithub.com/prisma/prisma/issues/13213) ##### Prisma - [Error: Error in migration engine. Reason: \[migration-engine\cli\src/main.rs:68:41\] called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidData, error: "stream did not contain valid UTF-8" } ](https://togithub.com/prisma/prisma/issues/5614) - [Allow creating GIN index on JSONB fields in Postgres adapter](https://togithub.com/prisma/prisma/issues/7410) - [`prisma format` panics when you use a colon to declare field type (`field: Type` syntax)](https://togithub.com/prisma/prisma/issues/9302) - [Better error message if using `TEXT` or `BLOB` in MySQL @​id/@​index/@​unique](https://togithub.com/prisma/prisma/issues/10292) - [Schema validation error mentions `Error parsing attribute "@​id"` but it's actually about `@@​id`](https://togithub.com/prisma/prisma/issues/10566) - [Support GiST Index type with Postgres](https://togithub.com/prisma/prisma/issues/10634) - [MySQL 8 function as default not created in first migration](https://togithub.com/prisma/prisma/issues/10715) - [Error: \[introspection-engine/connectors/sql-introspection-connector/src/commenting_out_guardrails.rs:32:59\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/11008) - [Nicer error message when you try to migrate a CockroachDB database with a `provider=posgresql` schema](https://togithub.com/prisma/prisma/issues/11350) - [Using `--url` for `db pull` ignored/overwrites `provider=cockroachdb`](https://togithub.com/prisma/prisma/issues/11527) - [CockroachDB: support more autoincrementing integer primary key representations](https://togithub.com/prisma/prisma/issues/12239) - [Prisma migrate always DROP DEFAULT on CockroachDB](https://togithub.com/prisma/prisma/issues/12244) - [Allow using a custom root certificate with SQL Server](https://togithub.com/prisma/prisma/issues/12672) - [Write basic tests for cockroachdb in prisma/prisma](https://togithub.com/prisma/prisma/issues/12926) - [CockroachDB: re-add Oid native type](https://togithub.com/prisma/prisma/issues/13003) - [Support Generalized Inverted Indices on CockroachDB](https://togithub.com/prisma/prisma/issues/13065) - [Missing validation on decimal defaults](https://togithub.com/prisma/prisma/issues/13074) - [Log error details in console when we fail to submit an error report](https://togithub.com/prisma/prisma/issues/13256) ##### Prisma Migrate - [CockroachDB session settings for migrations](https://togithub.com/prisma/prisma/issues/12113) ##### Language tools (e.g. VS Code) - [Autocompletion support for composite type indexes](https://togithub.com/prisma/language-tools/issues/1102) - [Add tests for new CockroachDB native types](https://togithub.com/prisma/language-tools/issues/1134) - [Completion for new CockroachDB sequences](https://togithub.com/prisma/language-tools/issues/1144) ##### Credits Huge thanks to [@​ever0de](https://togithub.com/ever0de), [@​flatplate](https://togithub.com/flatplate), [@​njmaeff](https://togithub.com/njmaeff), [@​tnzk](https://togithub.com/tnzk), [@​DePasqualeOrg](https://togithub.com/DePasqualeOrg) for helping! ##### Prisma Day [Prisma Day](https://prisma.io/day) is back this year, and it'll be on June 15 - 16 at the JamesJune Sommergarten in Berlin. Join us in-person or online for talks and workshops on modern application development and databases. Come and meet and chat with the team behind the Prisma ORM and Prisma Data Platform. ##### 💼 We're hiring! If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you. We're hiring for a number of roles: [Technical Support Engineer](https://grnh.se/ff0d8a702us), [Back-end Engineer: Prisma Data Platform](https://grnh.se/45afe7982us), and a [Developer Advocate(Frontend/ Fullstack)](https://grnh.se/894b275b2us). You can find more jobs we're hiring for on our [jobs page](https://www.prisma.io/jobs). Feel free to read through the job descriptions and apply using the links provided. ##### 📺 Join us for another "What's new in Prisma" livestream Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/XoS8D8q8icE) livestream. The stream takes place [on YouTube](https://youtu.be/XoS8D8q8icE) on **Thursday, May 12** at **5 pm Berlin | 8 am San Francisco**. ### [`v3.13.0`](https://togithub.com/prisma/prisma/releases/tag/3.13.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.12.0...3.13.0) Today, we are excited to share the `3.13.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%20v3.13.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.13.0) about the release.** 🌟 ##### Major improvements ##### `migrate diff` and `db execute` are now Generally Available! We released two new Preview CLI commands in version `3.9.0` – `prisma migrate diff` and `prisma db execute` – to enable our users to create and understand migrations and build their workflows using the commands. We're proud to announce that the commands are now Generally Available and can now be used without the `--preview-feature` flag. 🎉 The `prisma migrate diff` command creates a diff of your database schema, Prisma schema file, or the migration history. All you have to do is feed the command with a schema `from` state and a schema `to` state to get an SQL script or human-readable diff. In addition to `prisma migrate diff`, `prisma db execute` is used to execute SQL scripts against a database. You can directly execute `prisma migrate diff`'s output using `prisma db execute --stdin`. Both commands are non-interactive, so it's possible to build many new workflows such as forward and backward migrations with some automation tooling. Take a look at our documentation to learn some of the popular workflows these commands unlock: - [Fixing failed migrations](https://www.prisma.io/docs/guides/database/production-troubleshooting#fixing-failed-migrations-with-migrate-diff-and-db-execute) - [Squashing migrations](https://prisma.io/docs/guides/database/developing-with-prisma-migrate/squashing-migrations) - [Generating down migrations](https://prisma.io/docs/guides/database/developing-with-prisma-migrate/generating-down-migrations) - Command reference for [`migrate diff`](https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-diff) and [`db execute`](https://www.prisma.io/docs/reference/api-reference/command-reference#db-execute) Let us know what tools, automation, and scripts you build using these commands. ##### SQL Server index clustering (Preview) In version `3.5.0`, we introduced the `extendedIndexes` Preview feature which we have constantly been adding new configuration options for indexes. In this release, we added support for [enabling or disabling index/constraint clustering in SQL Server](https://www.prisma.io/docs/concepts/components/prisma-schema/indexes#configuring-if-indexes-are-clustered-or-non-clustered-with-clustered-sql-server). By default, indexes will be clustered by default. You can update this in your schema as follows to disable index clustering: ```prisma datasource db { provider = "sqlserver" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["extendedIndexes"] } model Post { id Int @​default(autoincrement()) @​id(clustered: false) title String content String? } ``` The following SQL will be generated in your migration when you run `prisma migrate dev` ```sql CREATE TABLE [Post] ( id INT NOT NULL, [title] VARCHAR(255) NOT NULL, [content] NVARCHAR(1000), CONSTRAINT [Post_pkey] PRIMARY KEY NONCLUSTERED (id) ) ``` If you've enabled the `extendedIndexes` Preview feature, this is potentially a breaking change. Refer to our [documentation](https://www.prisma.io/docs/concepts/components/prisma-schema/indexes#upgrading-from-previous-versions) to learn how you can upgrade from a previous version. ##### Updated native types for CockroachDB (Preview) We have revamped the native types available in the CockroachDB connector. We initially re-used the PostgreSQL native types because they were close enough, but we have now adapted our list of the supported native types to match what CockroachDB supports. If you are already using CockroachDB in your project, you can run `prisma db pull` to update all the native types in your Prisma schema. Refer to our [documentation](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#model-field-scalar-types) for the complete list of all CockroachDB native types. ##### OpenSSL 3.0 Support We're excited to announce that version `3.13.0` now supports [OpenSSL 3.0](https://www.openssl.org/). Operating systems such as Ubuntu 22.04 default to OpenSSL 3.0, and when running `prisma generate`, you would run into the following error: Error: Unknown binaryTarget debian-openssl-3.0.x If you've run into a similar error, bump up to the latest Prisma version and give it another try! ##### Fixes and improvements ##### Prisma Client - [Support OpenSSL 3.0](https://togithub.com/prisma/prisma/issues/11356) - [Create a test factory for newer and cleaner tests](https://togithub.com/prisma/prisma/issues/11573) - [Invalid Binary Target for OpenSSL V3 on CentOS Stream 9](https://togithub.com/prisma/prisma/issues/11677) - [thread 'tokio-runtime-worker' panicked at 'not yet implemented'](https://togithub.com/prisma/prisma/issues/12704) ##### Prisma - [`prisma init` needs CockroachDB in the providers list](https://togithub.com/prisma/prisma/issues/11633) - [db execute: confusing error message when doing `DROP DATABASE "test-doesnotexists;"` says that `Database postgres.public does not exist`](https://togithub.com/prisma/prisma/issues/11673) - [\[Diff\] Always error if path to Sqlite db is wrong or db does not exist](https://togithub.com/prisma/prisma/issues/12226) - [CockroachDB: Change the integer native types to the idiomatic ones](https://togithub.com/prisma/prisma/issues/12236) - [CockroachDB: use idiomatic native types](https://togithub.com/prisma/prisma/issues/12237) - [Prisma `migrate diff` just crashed. ](https://togithub.com/prisma/prisma/issues/12351) - [`prisma init --datasource-provider=cockroachdb --url ...` sets provider to `postgresql`](https://togithub.com/prisma/prisma/issues/12360) - [MongoDB: Add spinner to Introspection](https://togithub.com/prisma/prisma/issues/12632) - [Remove `--preview-feature` flag for Primitives (`migrate diff` and `db execute`)](https://togithub.com/prisma/prisma/issues/12679) - ["reportFailedMessage" is never displayed in case a panic error fails to be submitted to the reporting service](https://togithub.com/prisma/prisma/issues/12739) - [Support defining index clustering](https://togithub.com/prisma/prisma/issues/12871) - [MongoDB: Invalid relation does not throw validation error ](https://togithub.com/prisma/prisma/issues/12930) ##### Language tools (e.g. VS Code) - [Rework auto completion tests](https://togithub.com/prisma/language-tools/issues/849) - [Internal: For PR / branches it would be great to have an easy way to test the VS Code extension](https://togithub.com/prisma/language-tools/issues/1005) ##### Prisma Engines - [Moving to NAPI-rs v2](https://togithub.com/prisma/prisma-engines/issues/2829) ##### Credits Huge thanks to [@​ever0de](https://togithub.com/ever0de), [@​jacobhq](https://togithub.com/jacobhq), [@​dkantereivin](https://togithub.com/dkantereivin), [@​CommanderRoot](https://togithub.com/CommanderRoot) for helping! ##### 💼 We're hiring! If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you. We're looking for a [Technical Support Engineer](https://grnh.se/ff0d8a702us) and [Senior Software Engineer (Prisma Data Platform)](https://grnh.se/484964dd2us). Feel free to read through the job descriptions and apply using the links provided. ##### 📺 Join us for another "What's new in Prisma" livestream Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/mzWBmhWluKk) livestream. The stream takes place [on YouTube](https://youtu.be/mzWBmhWluKk) on **Thursday, April 28** at **5 pm Berlin | 8 am San Francisco**. ### [`v3.12.0`](https://togithub.com/prisma/prisma/releases/tag/3.12.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.11.1...3.12.0) Today, we are excited to share the `3.12.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%20v3.12.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.12.0) about the release.** 🌟 ##### Major improvements and new features ##### MongoDB is now Generally Available If you’ve been using MongoDB since it was in Preview, we'd like to say: **Thank you!** Your testing and feedback has been essential during the preview phase, and our MongoDB support is much better because of it. Today we’re proud to announce that MongoDB is now stable and production-ready. After upgrading to `3.12.0`, you can remove the MongoDB preview flag in your schema: ```diff datasource db { provider = "mongodb" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" - previewFeatures = ["mongoDb"] } ``` We’ve been working hard towards this day ever since we launched MongoDB in [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) in July 2021. Here are some of the feature highlights we developed over this period: - Expressive and type-safe operations for querying MongoDB **embedded documents** - Thorough **introspection support** for using Prisma with existing MongoDB databases - **Declarative index management** right from your Prisma Schema with `db push` - Powerful **raw query APIs** to help you incrementally migrate to Prisma You can learn about these features in the [release blog post](https://prisma.io/blog/mongodb-general-availability-pixnun6mffmu), and more, in our freshly brewed [MongoDB Guide](https://prisma.io/docs/guides/database/using-prisma-with-mongodb). For newcomers to Prisma with MongoDB, we recommend you check out our [Getting Started Guide](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/mongodb-typescript-mongodb). To celebrate this milestone, we invite you to join [Prisma’s MongoDB Launch Week](https://www.prisma.io/mongodb-launch/?utm_source=github\&utm_medium=releasenotes\&utm_campaign=mongodblaunch) starting on April 25th. Enjoy a jam-packed week of exclusive workshops with plenty of opportunities to win free MongoDB Atlas credits and swag. It’s free to [sign-up](https://www.prisma.io/mongodb-launch/?utm_source=github\&utm_medium=releasenotes\&utm_campaign=mongodblaunch) and available anywhere you have an internet connection. 🚨 Please be aware that we made a few **breaking changes** to tie up loose ends before General Availability: - [`@db.Array` replaced with `@db.ObjectId`](https://togithub.com/prisma/prisma/issues/11226) - [Removed Decimal support](https://togithub.com/prisma/prisma/issues/12637) We made some changes in the [`3.11.1` patch release](https://togithub.com/prisma/prisma/releases/tag/3.11.1) in case you missed it. ##### Index support on composite type fields We also added support for adding indexes on embedded document fields in MongoDB. This means that you can now define a normal, unique, or full-text index in your schema. ```prisma type Address { street String number Int } model User { id Int @​id email String address Address @​@​index([email, address.number]) /// normal index @​@​unique([email, address.street]) /// unique index @​@​fulltext([email, address.street]) /// full-text index } ``` > Note: Prisma Client does not yet fully support the feature for now. This will be rolled out in a future release. ##### Improved Connection Pooling Resiliency In `3.12.0`, we busted a ghost that has been bugging teams since the early days of the Prisma ORM. Under certain amounts of load, some people reported that the connection pool would sometimes drop connections or deadlock and not recover. After many sightings and a lot of head-scratching, we were finally able to reproduce the issue. This allowed us to narrow down the problem to one of our dependencies and fix the problem. To read the nitty gritty details of the problem and our solution, check out [this issue](https://togithub.com/importcjj/mobc/issues/63#issuecomment-1060295772). ##### Fixes and improvements ##### Prisma Client - [Bundling fails on 2.21.0](https://togithub.com/prisma/prisma/issues/6564) - ["Timed out fetching a new connection from the pool" message is misleading](https://togithub.com/prisma/prisma/issues/6898) - [I get "Can't resolve '\_http_common'" when I use NestJS with monorepo (webpack)](https://togithub.com/prisma/prisma/issues/6899) - [Broken on Next.js 10.2.0 which uses Webpack 5 when running a custom server to support HTTPS locally](https://togithub.com/prisma/prisma/issues/6925) - [Timed out fetching a new connection from the pool](https://togithub.com/prisma/prisma/issues/7249) - [Multiple prisma with nx workspaces and nestjs](https://togithub.com/prisma/prisma/issues/7470) - [Prisma Client (Binary): upgrade to undici@4](https://togithub.com/prisma/prisma/issues/7539) - [issue with connection pool ?](https://togithub.com/prisma/prisma/issues/7644) - [Prisma does not recover from PrismaClientInitializationError](https://togithub.com/prisma/prisma/issues/9420) - [Connection pool timeout errors when using higher connection_limit](https://togithub.com/prisma/prisma/issues/9622) - [DB connection retry not happening](https://togithub.com/prisma/prisma/issues/9967) - [Prisma does not recover from DB being down on start up](https://togithub.com/prisma/prisma/issues/10153) - [Prisma client never recovers from P1001 ](https://togithub.com/prisma/prisma/issues/10240) - [`new PrismaClient()` can not find `schema.prisma` file when use with pnpm workspace](https://togithub.com/prisma/prisma/issues/10361) - [Prisma client cannot find datamodel path ("schema.prisma")](https://togithub.com/prisma/prisma/issues/10512) - [Interactive Transaction concurrent writes cause Prisma to hang](https://togithub.com/prisma/prisma/issues/11750) - [MongoDB: improve error message `Inconsistent column data: Malformed ObjectID` by including the field(s) in the message ](https://togithub.com/prisma/prisma/issues/11885) - [Unable to establish a connection once database recovers](https://togithub.com/prisma/prisma/issues/12028) - [Composite Type should disallow null on a required contains one](https://togithub.com/prisma/prisma/issues/12078) - [Prisma 3.9.x+ multiple clients being generated, and in the wrong Yarn 1 workspace](https://togithub.com/prisma/prisma/issues/12083) - [MongoDB: `Inconsistent column data: Failed to convert ...` error on invalid data in properties does not mention affected field (and other useful information)](https://togithub.com/prisma/prisma/issues/12096) - [MongoDB findRaw doesn't seem to work](https://togithub.com/prisma/prisma/issues/12124) - [errorFormat:"minimal" or other options not working](https://togithub.com/prisma/prisma/issues/12130) - [Interactive transactions are not logging DB queries](https://togithub.com/prisma/prisma/issues/12145) - [Count action ends up being called aggregate when checking in middleware](https://togithub.com/prisma/prisma/issues/12222) - [MongoDB logging `QueryEvent` type `params` is `undefined`](https://togithub.com/prisma/prisma/issues/12319) - [MDBGA: Finish refactoring MongoDB queries to use boolean expressions](https://togithub.com/prisma/prisma/issues/12362) - [Re-evaluate and -confirm supported native types on MongoDB](https://togithub.com/prisma/prisma/issues/12382) - [Allow to filter by undefined fields in MongoDB](https://togithub.com/prisma/prisma/issues/12478) - [MongoDB GA: Remove Preview Feature checks and Preview mentions](https://togithub.com/prisma/prisma/issues/12628) ##### Prisma - [Connection issues never seem to go away(how to deploy prisma live reliably) \[MySQL, TypeGraphQL, EBS\]](https://togithub.com/prisma/prisma/issues/7128) - [Error: \[libs/datamodel/connectors/dml/src/model.rs:222:92\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/9546) - [Error: \[libs\sql-schema-describer\src\lib.rs:171:32\] Column id not found in Table videos ](https://togithub.com/prisma/prisma/issues/9791) - [Prisma Migrate shows warning when editing rolled-back migration](https://togithub.com/prisma/prisma/issues/9829) - [Prisma client not attempting to reconnect on "Can't reach database server"](https://togithub.com/prisma/prisma/issues/9902) - [Error: Error in migration engine. Reason: \[libs\sql-schema-describer\src\walkers.rs:592:14\] STATE ERROR BOOP ](https://togithub.com/prisma/prisma/issues/10454) - [Error report](https://togithub.com/prisma/prisma/issues/10577) - [MongoDB type inference mismatch](https://togithub.com/prisma/prisma/issues/11808) - [Error: \[libs\datamodel\core\src\transform\dml_to_ast\mod.rs:74:59\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/12033) - [Cannot use `prisma db push` on MongoDB with `@unique` id](https://togithub.com/prisma/prisma/issues/12149) - [CockroachDB: Remove the Json native type](https://togithub.com/prisma/prisma/issues/12234) - [Error: \[libs/datamodel/connectors/dml/src/model.rs:363:66\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/12259) - [Error: \[libs/datamodel/core/src/transform/dml_to_ast/mod.rs:74:59\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/12261) - [Can `migrate diff` correctly resolve relative SQLite file path from schema? ](https://togithub.com/prisma/prisma/issues/12265) - [Introspection: MongoDB: Warnings mention Native Types instead of PSL types (e.g. Document instead of Json)](https://togithub.com/prisma/prisma/issues/12321) - [MongoDB: Mixed data comments should mention PSL types instead of Mongo Native Types (`Int32` => `Int`)](https://togithub.com/prisma/prisma/issues/12398) - [Composite Indices: Support in the PSL](https://togithub.com/prisma/prisma/issues/12406) - [Composite Indices: MongoDB Introspection Connector](https://togithub.com/prisma/prisma/issues/12407) - [Composite Indices: MongoDB Migration Connector](https://togithub.com/prisma/prisma/issues/12408) - [\[MDB\] Validate valid field / key names in the datamodel](https://togithub.com/prisma/prisma/issues/12410) - [Introspecting indexes on embedded documents leads to validation error](https://togithub.com/prisma/prisma/issues/12449) - [\[Mongo\] Improve native type validations in composite types](https://togithub.com/prisma/prisma/issues/12460) - [\[Mongo\] Too generic error messages in composite types](https://togithub.com/prisma/prisma/issues/12462) ##### Prisma Migrate - [Unique/Index keeps getting recreated](https://togithub.com/prisma/prisma/issues/11631) - [Introspected CockroachDB schema has different field type than original Prisma schema that was migrated](https://togithub.com/prisma/prisma/issues/12281) ##### Language tools (e.g. VS Code) - [`prisma-fmt` panic when `@db.Array()` is added in a MongoDB schema](https://togithub.com/prisma/language-tools/issues/1070) - [Embedded many-to-many relations do not suggest valid values in `references`](https://togithub.com/prisma/language-tools/issues/1075) - [@​relation auto completion: fields and references are still suggested when already present (when trailing comma is missing)](https://togithub.com/prisma/language-tools/issues/1080) - [Native type `Array()` is still auto suggested](https://togithub.com/prisma/language-tools/issues/1081) ##### Prisma Engines - [ \[Composites\] Implement `updateMany` write operation](https://togithub.com/prisma/prisma-engines/issues/2534) - [ \[Composites\] Implement `deleteMany` write operation](https://togithub.com/prisma/prisma-engines/issues/2535) - [Remove decimal support from MongoDB](https://togithub.com/prisma/prisma-engines/issues/2600) - [Investigate intermittently failing cockroachdb test suite on buildkite](https://togithub.com/prisma/prisma-engines/issues/2741) - [\[MongoDB\] Having filters don't work without selection](https://togithub.com/prisma/prisma-engines/issues/2768) ##### Credits Huge thanks to [@​ever0de](https://togithub.com/ever0de), [@​chronotc](https://togithub.com/chronotc), [@​hayes](https://togithub.com/hayes), [@​maddhruv](https://togithub.com/maddhruv), [@​jasimon](https://togithub.com/jasimon), [@​codesee-maps](https://togithub.com/codesee-maps)\[bot], [@​andyrichardson](https://togithub.com/andyrichardson), [@​xnerhu](https://togithub.com/xnerhu), [@​Josh-a-e](https://togithub.com/Josh-a-e), [@​dusandz](https://togithub.com/dusandz) for helping! ##### 💼 We're hiring! If you're interested in joining our growing team to help empower developers build data-intensive applications, Prisma is the place for you. We're looking for a [Developer Success Engineer](https://grnh.se/ff0d8a702us) and [Back-end Engineer: Prisma Data Platform](https://grnh.se/45afe7982us). Feel free to read through the job descriptions and apply using the links provided. ##### 📺 Join us for another "What's new in Prisma" livestream Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/TGMF8ykS29M) livestream. The stream takes place [on YouTube](https://youtu.be/TGMF8ykS29M) on **Thursday, April 7** at **5 pm Berlin | 8 am San Francisco**. ### [`v3.11.1`](https://togithub.com/prisma/prisma/releases/tag/3.11.1) [Compare Source](https://togithub.com/prisma/prisma/compare/3.11.0...3.11.1) Today, we are issuing the `3.11.1` patch release. ### MongoDB (Preview) #### Breaking: Filters no longer return `undefined` fields by default In `3.11.1`, we've changed what data is returned when filtering MongoDB documents on `undefined` fields. The new rule is that `undefined` fields are excluded by default unless explicitly filtered for. This allows you to query for undefined and null values separately. Let's take a look at a concrete example. Given the following Prisma schema: ```prisma model Address { id Int @​id @​map("_id") city String street String? // Note that street is optional } ``` For Mongo, optional fields can either be `null` or `undefined` (absent). The following documents are all valid for the schema above: ```ts { "_id": 1, "city": "San Fransisco", "street": "Market st." } { "_id": 2, "city": "Seattle", "street": null } { "_id": 3, "city": "Chicago" } ``` Prior to `3.11.1`, if you queried for `where: { street: null }`, you'd get `_id: 2` and `_id: 3`. In `3.11.1`, you'll only get `_id: 2`. The ability to *also* query for the missing fields has also been added. For details, refer to the new `isSet` below to learn more. There are a few exceptions to this new default: - A `having` filter on an aggregated field *will* return `undefined` fields. This is because aggregation on undefined fields yields `null`, not `undefined`, thus matching the filter. - Filters on undefined to-many relations (e.g., the backing array of a many-to-many is `undefined`) will currently include those relations in the result set. #### New `isSet` filter operation To compensate for missing fields on documents no longer being returned by the filters above, we’ve added a new `isSet: bool` filter. This filter can be used to include fields that are `undefined` on documents. Using the example above, to include the `undefined` fields, you can use an `OR`: ```ts await prisma.address.findMany({ where: { OR: [ { street: { isSet: false } }, { street: null } ] } }) ``` The `isSet` operation has been added to all scalar and embedded fields that are optional. #### New `unset` operation In `3.11.1`, you can also remove a field with the `unset` operation. Using the example above, let's write a query to remove the street field: ```ts await prisma.address.update({ where: { id: 10, }, data: { street: { unset: true, }, }, }) ``` This effectively sets the `street` field to `undefined` in the database. #### New `updateMany` operation We now support updating embedded documents that match specific criteria. For example, given the following schema: ```prisma model Product { id Int @​id @​map("_id") name String @​unique photos Photo[] } type Photo { height Int @​default(200) width Int @​default(100) url String } ``` Let's update the photo with a `url` of `1.jpg` to `2.png`: ```ts const product = prisma.product.update({ where: { id: 10, }, data: { photos: { updateMany: { where: { url: '1.jpg', }, data: { url: '2.png', }, }, }, }, }) ``` #### New `deleteMany` operation Similar to `updateMany`, you can also remove embeds that match specific criteria. Using the Prisma Schema above, let's delete all photos with a `height` of 100: ```ts const product = prisma.product.update({ where: { id: 10, }, data: { photos: { deleteMany: { where: { height: 100, }, }, }, }, }) ``` ### [`v3.11.0`](https://togithub.com/prisma/prisma/releases/tag/3.11.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.10.0...3.11.0) Today, we are excited to share the `3.11.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%20v3.11.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.11.0) about the release.** 🌟 #### Major improvements and new features ##### Experimental support for Embedded Document Filters In the previous release, we added embedded document support for creates, updates, and deletes. In version `3.11.0`, we’re adding the ability to filter embedded documents. Given the following schema: ```prisma datasource db { provider = "mongodb" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["mongoDb"] } model Product { id String @​id @​default(auto()) @​map("_id") @​db.ObjectId photos Photo[] } model Order { id String @​id @​default(auto()) @​map("_id") @​db.ObjectId shippingAddress Address billingAddress Address? } type Photo { height Int width Int url String } type Address { street String city String zip String } ``` You can now filter within an embedded document: ```ts // find all orders with the same shipping address const orders = await prisma.order.findMany({ where: { shippingAddress: { equals: { street: "555 Candy Cane Lane", city: "Wonderland", zip: "52337", }, }, }, }) ``` You can also filter on a "contains many" relationship: ```ts // find all products that don't have photos const product = prisma.product.findMany({ where: { photos: { isEmpty: true } }, }) ``` This scratches the surface of what's possible. For a complete list of available operations, have a look at [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/composite-types). Please share your feedback in [this issue](https://togithub.com/prisma/prisma/issues/8241). ##### Ordering by embedded documents is in Preview In addition to filtering, Prisma version `3.11.0` now supports sorting by an embedded document. Using the example schema above, you can sort orders by their zip code: ```ts // sort orders by zip code in ascending order const orders = await prisma.order.findMany({ orderBy: { shippingAddress: { zip: "asc", }, }, }) ``` Learn more about thi

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.



This PR was generated by Mend Renovate. View the repository job log.