This is an easy-to-use free open-source music bot called Stereo. You can host it yourself or use our own hosted version. Checkout https://stereo-bot.xyz/ for more information!
prisma/prisma
### [`v3.11.0`](https://togithub.com/prisma/prisma/releases/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 this feature in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/composite-types) and don’t hesitate to reach out in [this issue](https://togithub.com/prisma/prisma/issues/8241).
##### MongoDB query logging support
In this release, we’ve added the ability to log MongoDB queries. You can enable query logging in the `PrismaClient` constructor:
```ts
const prisma = new PrismaClient({
log: [
{
emit: 'event',
level: 'query',
},
]
})
prisma.$on('query', (e) => console.log(e.query))
```
After enabling query logging, you'll start to see logs that resemble this in your console:
```bash
db.User.deleteMany({ _id: ( $in: [ “62261e0b18139c6099ba7097”, ], }, })
db.User.deleteMany({ _id: ( $in: [ “6226277a96069500743edcf9”, ], }, })
```
The logs output by Prisma have the same format as the `mongosh` console, so you can pipe the queries from your logs directly into your shell.
##### MongoDB introspection update
We've updated the type inference behavior for MongoDB on introspection.
Prisma samples a field's data to select an appropriate type on introspection. In the past, Prisma picked the type used most often for fields with data with multiple types. However, this could cause problems when retrieving mixed data during runtime and throw exceptions, such as Prisma Studio or in Prisma Client queries.
From `3.11.0`, Prisma defaults to the `Json` type to all fields with mixed data types instead. Additionally, Prisma will still show a warning on the console and add a comment to the introspected Prisma schema so it is clear where such cases occur and that you can do something to fix them.
##### Prisma Client logger revamp
In `3.11.0`, we’ve rewritten our internal logger to reduce [lock contention](https://en.wikipedia.org/wiki/Lock_\(computer_science\)#:~:text=lock%20contention%3A%20this%20occurs%20whenever,lock%20held%20by%20the%20other.) and enable future features like tracing. This is the first of many upcoming changes to improve the Prisma Client’s throughput, so if you were running into an upper limit on query performance, it’s time to update Prisma Client and give it a try!
If you're running into query performance issues, please [open an issue](https://togithub.com/prisma/prisma/issues/new/choose) or [connect with us on Slack](https://slack.prisma.io/).
##### CockroachDB now supports migrations (Preview)
We're excited to announce Preview support for migrations for CockroachDB. You can now evolve your Prisma schema and propagate the changes to your database using Prisma Migrate.
Give the feature a try and let us know what you think in [this issue](https://togithub.com/prisma/prisma/issues/11542).
##### Detecting state of a diff with `migrate diff` using exit code
Prisma version `3.11.0` includes a new `--exit-code` flag to the `migrate diff` command to detect the state of a diff in several ways.
You can use the flag as follows:
```bash
npx prisma migrate diff --preview-feature \
--exit-code \
--from-[...] \
--to-[...]
```
Here's a list of the default and changed behavior of the error codes:
#### Default behavior of exit codes
0: Returned when the diff is empty or non-empty
1: Returned on error
#### Changed behavior when --exit-code is used
0: Returned when the diff is empty
1: Returned on error
2: Returned when the diff is non-empty
Read about it in the [reference documentation](https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-diff).
#### Fixes and improvements
##### Prisma
- [Command to export SQL schema](https://togithub.com/prisma/prisma/issues/1992)
- [Waiting "too long" to input migration name leads to error message](https://togithub.com/prisma/prisma/issues/7742)
- [`db push` with empty `schema.prisma`: `Error: TypeError: Cannot read properties of undefined (reading 'url')`](https://togithub.com/prisma/prisma/issues/9518)
- [migrate diff: --{from,to}-schema-datamodel should not error on missing env vars in datasource blocks ](https://togithub.com/prisma/prisma/issues/11544)
- [migrate diff: Provide a reliable way to detect empty diffs / migrations](https://togithub.com/prisma/prisma/issues/11566)
- [`db execute` cannot resolve SQLite file path from schema](https://togithub.com/prisma/prisma/issues/11626)
- [\[MDB\] Implement version and describe RPC calls for the error reporting backend](https://togithub.com/prisma/prisma/issues/11691)
- [\[MDB\] Create fields referenced in index definitions as Json to enable display of indexes in datamodel ](https://togithub.com/prisma/prisma/issues/11933)
- [MongoDB many to many: `PANIC: called Option::unwrap() on a None`](https://togithub.com/prisma/prisma/issues/11970)
##### Prisma Client
- [PANIC in query-engine/connectors/mongodb-query-connector/src/value.rs:185:24not yet implemented: (Json, Json("\[\]"))](https://togithub.com/prisma/prisma/issues/6773)
- [Prisma Mongo Panic called `Option::unwrap()` on a `None` value](https://togithub.com/prisma/prisma/issues/8598)
- [Better error message for MongoDB replica sets](https://togithub.com/prisma/prisma/issues/8719)
- [MongoDB: Using `tlsCAFile` fails](https://togithub.com/prisma/prisma/issues/9072)
- [no such file or directory, open '/path/schema.prisma' since 3.1.1](https://togithub.com/prisma/prisma/issues/9435)
- [PANIC: called `Option::unwrap()` on a `None` value in query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs:301:74](https://togithub.com/prisma/prisma/issues/9977)
- [`contains` string filter not working with mongoDB](https://togithub.com/prisma/prisma/issues/10267)
- [Referential integrity is not preserved when updating foreign key (in "prisma" mode)](https://togithub.com/prisma/prisma/issues/11100)
- [PANIC: called `Option::unwrap()` on a `None` value in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:112:74](https://togithub.com/prisma/prisma/issues/11378)
- [HasReject not evaluating correctly for per operation handlers](https://togithub.com/prisma/prisma/issues/11403)
- [Support MongoDB "query" logging](https://togithub.com/prisma/prisma/issues/11419)
- [CONTRIBUTING: document Prisma Client workflow of using local link ](https://togithub.com/prisma/prisma/issues/11828)
- [MongoDB findRaw filter problem with ObjectId field.](https://togithub.com/prisma/prisma/issues/11830)
- [MongoDB: Better error message for when document does not match the defined schema](https://togithub.com/prisma/prisma/issues/11853)
- [Integrate orderBy for composite types](https://togithub.com/prisma/prisma/issues/12038)
- [Attempting to do a query in the Prisma Client on a model with a foreign key that has `@map` panics on 3.10.0](https://togithub.com/prisma/prisma/issues/12105)
- [Use embedded documents attributes in where clause](https://togithub.com/prisma/prisma/issues/12186)
- [`'then' in PrimsaPromise` returns false](https://togithub.com/prisma/prisma/issues/12252)
##### Prisma Migrate
- [Detect schema drift helper / `migrate dev --exit-code`](https://togithub.com/prisma/prisma/issues/9707)
- [Migrate lock timeout on PlanetScale](https://togithub.com/prisma/prisma/issues/10997)
##### Language tools (e.g. VS Code)
- [MongoDB M:N relations get referential actions auto completion suggestions, then does not validate](https://togithub.com/prisma/language-tools/issues/1060)
- [Auto Completion: `map` does not exist for M:N in MongoDB](https://togithub.com/prisma/language-tools/issues/1061)
- [Autocomplete shows invalid suggestions for composite types](https://togithub.com/prisma/language-tools/issues/1063)
- [Suggest auto() in VSCode autocomplete](https://togithub.com/prisma/language-tools/issues/1064)
- [Clicking on a MongoDB composite type does not jump to definition](https://togithub.com/prisma/language-tools/issues/1069)
##### Prisma Engines
- [Implement order by composites](https://togithub.com/prisma/prisma-engines/issues/2514)
- [\[Composites\] Implement `equals` read operation](https://togithub.com/prisma/prisma-engines/issues/2675)
- [\[Composites\] Implement `is` read operation](https://togithub.com/prisma/prisma-engines/issues/2676)
- [\[Composites\] Implement `isNot` read operation](https://togithub.com/prisma/prisma-engines/issues/2677)
- [\[Composites\] Implement `isEmpty` read operation](https://togithub.com/prisma/prisma-engines/issues/2678)
- [\[Composites\] Implement `every` read operation](https://togithub.com/prisma/prisma-engines/issues/2679)
- [\[Composites\] Implement `some` read operation](https://togithub.com/prisma/prisma-engines/issues/2680)
- [\[Composites\] Implement `none` read operation](https://togithub.com/prisma/prisma-engines/issues/2681)
#### Credits
Huge thanks to [@hayes](https://togithub.com/hayes), [@maddhruv](https://togithub.com/maddhruv), [@jasimon](https://togithub.com/jasimon) for helping!
#### 📺 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/2dAtmHuT-30) livestream.
The stream takes place [on YouTube](https://youtu.be/2dAtmHuT-30) on **Thursday, March 17** at **5 pm Berlin | 8 am San Francisco**.
### [`v3.10.0`](https://togithub.com/prisma/prisma/releases/3.10.0)
[Compare Source](https://togithub.com/prisma/prisma/compare/3.9.2...3.10.0)
Today, we are excited to share the `3.10.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.10.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.10.0) about the release.** 🌟
#### Major improvements and new features
We are working towards a stable release of MongoDB and are shipping lots of improvements. **All the new features and changes in this release therefore only apply to the MongoDB connector.** Take a closer look if you are using the [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) of MongoDB as some of the changes are breaking.
##### Embedded documents support is now in Preview
We're super excited to announce that Prisma version `3.10.0` supports reading and modifying embedded documents. Embedded documents will provide access to a new `type` keyword in your Prisma schema that you can use to define composite types.
```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
name String
photos Photo[]
}
type Photo {
height Int
width Int
url String
}
```
Given the schema above, you can now read and write to the embedded `photos` array:
```ts
// Create a new product with an embedded list of photos
const product = await prisma.product.create({
data: {
name: "Forest Runners",
// Create an embedded list of photos in the product
photos: [
{ height: 100, width: 200, url: "1.jpg" },
{ height: 300, width: 400, url: "2.jpg" },
],
},
})
```
Best of all, the query is entirely type-safe! This scratches the surface of what's possible with embedded documents. You can read further in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/composite-types).
If you run into anything, feel free to [open an issue](https://togithub.com/prisma/prisma/issues/new/choose), and we’ll give you a hand!
##### Introspection of embedded documents is now enabled by default
We added Preview support for Introspection of embedded documents in version `3.4.0` and are now activating it for all users. Running `prisma db pull` against your MongoDB database will generate `type` definitions within your Prisma schema.
When introspecting your database, you can switch off the depth with `--composite-type-depth=0`, or limit it with, for example, `--composite-type-depth=2`.
Feel free to drop your feedback on the feature on [GitHub](https://togithub.com/prisma/prisma/issues/10016).
##### `@default(dbgenerated())` is now replaced with `@default(auto())`
The original purpose of `dbgenerated` is to support SQL expressions Prisma doesn’t understand yet. However, MongoDB doesn’t have a concept of default value expressions like SQL does. We took this opportunity to simplify how we handle the default values in MongoDB:
```diff
model Post {
- id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
+ id String @id @default(auto()) @map("_id") @db.ObjectId
}
```
##### Many-to-Many relations now require a `references` argument
Prisma version `3.10.0` now enforces all arguments in a MongoDB many-to-many relation. This means a `@relation` attribute must define `fields` and `references` arguments on both sides.
The `fields` argument must point to a scalar field in the same model, and this scalar field must be an array. The `references` arguments must point to a scalar field in the opposite model, and it must be a singular type of the same base type as the referencing array on the other side.
```diff
model Post {
id String @id @map("_id") @default(auto()) @db.ObjectId
category_ids String[] @db.ObjectId
- categories Category[] @relation(fields: [category_ids])
+ categories Category[] @relation(fields: [category_ids], references: [id])
}
model Category {
id String @id @map("_id") @default(auto()) @db.ObjectId
post_ids String[] @db.ObjectId
- posts Post[] @relation(fields: [post_ids])
+ posts Post[] @relation(fields: [post_ids], references: [id])
}
```
##### `@db.Array(ObjectId)` is now updated to `@db.ObjectId`
We've adjusted the Prisma schema format for scalar lists with native types (like lists of Object IDs). This will likely affect those with many-to-many relationships in MongoDB. We made this change to align MongoDB with our existing SQL databases better:
```diff
model Post {
id String @id @default(auto()) @map("_id") @db.ObjectId
- categoryIDs String[] @db.Array(ObjectId)
+ categoryIDs String[] @db.ObjectId
categories Category[] @relation(fields: [categoryIDs], references: [id])
}
model Category {
id String @id @default(auto()) @map("_id") @db.ObjectId
- postIDs String[] @db.Array(ObjectId)
+ postIDs String[] @db.ObjectId
posts Post[] @relation(fields: [postIDs], references: [id])
}
```
#### Fixes and improvements
##### Prisma Migrate
- [Ability to create SQL table logic from schema without doing a "migrate"](https://togithub.com/prisma/prisma/issues/6155)
- [Improve error on default values when `@db.ObjectId` isn't present](https://togithub.com/prisma/prisma/issues/6429)
- [Validator accepts arbitrary properties in `datasource` blocks](https://togithub.com/prisma/prisma/issues/7342)
- [Programmatically create a MongoDB database](https://togithub.com/prisma/prisma/issues/8582)
- [`prisma init --url` does not like `mongodb+srv://`](https://togithub.com/prisma/prisma/issues/9644)
- [Test the error reporting backend with MongoDb](https://togithub.com/prisma/prisma/issues/10528)
- [Better Schema validation for MongoDB](https://togithub.com/prisma/prisma/issues/10809)
- [`Code 19` and unformatted list output during Re-Introspection](https://togithub.com/prisma/prisma/issues/11025)
- [MongoDB Introspection Multiple Types warning message in CLI output does not differentiate models and embedded documents](https://togithub.com/prisma/prisma/issues/11179)
- [MongoDB Introspection Embedded Documents do not require `id_` special case](https://togithub.com/prisma/prisma/issues/11180)
- [Introspection result `Unsupported("Unknown")` causes schema validation to crash](https://togithub.com/prisma/prisma/issues/11181)
- [Confidence Tooling run and result verification for embedded documents](https://togithub.com/prisma/prisma/issues/11182)
- [MongoDB Introspection connects to database even when failing with error message that should not require connection to database at all](https://togithub.com/prisma/prisma/issues/11185)
- [Change `@db.Array(ObjectId)` to `@db.ObjectId`](https://togithub.com/prisma/prisma/issues/11226)
- [Make sure `Unsupported(...)` fields are not rejected on composite types](https://togithub.com/prisma/prisma/issues/11282)
- [MongoDB PSL parsing should fail when using `@default(autoincrement())`](https://togithub.com/prisma/prisma/issues/11291)
- [Error: \[/root/build/libs/mongodb-schema-describer/src/lib.rs:35:41\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/11300)
- [MongoDB embedded documents Introspection does not give any names to fields with invalid names](https://togithub.com/prisma/prisma/issues/11390)
- [Embedded document `_id` of type `ObjectId` are introspected without native type ` @db.ObjectId `](https://togithub.com/prisma/prisma/issues/11396)
- ["experimental feature, needs to be enabled"](https://togithub.com/prisma/prisma/issues/11482)
- [MongoDB: On ID fields, replace `@default(dbgenerated())` with `@default(auto())`](https://togithub.com/prisma/prisma/issues/11552)
- [Implement datamodel parser validations for two-way embedded many-to-many relations on MongoDB](https://togithub.com/prisma/prisma/issues/11553)
- [MongoDB: The connection string format and parameters are defined by mongo-rust-driver](https://togithub.com/prisma/prisma/issues/11567)
- [`prisma db pull` doesn't read `.env` file and errors with Environment variable not found: DATABASE_URL](https://togithub.com/prisma/prisma/issues/11570)
- [\[MDB\] Do not hardcode \_id to ObjectId during Introspection](https://togithub.com/prisma/prisma/issues/11623)
- [\[MDB\] Schema validation error on valid composite type](https://togithub.com/prisma/prisma/issues/11625)
- [Turn on embedded document Introspection by default](https://togithub.com/prisma/prisma/issues/11797)
- [`Model "undefined", field: ...`](https://togithub.com/prisma/prisma/issues/11809)
- [MongoDB Introspection does not output how many embedded documents were introspected](https://togithub.com/prisma/prisma/issues/11827)
- [Sharded MongoDB connection string is not supported by Prisma Client](https://togithub.com/prisma/prisma/issues/11873)
- [Add mongodb 4.2 to tested versions on migrate & introspection](https://togithub.com/prisma/prisma/issues/11884)
- [Confirm sharded MongoDB connection string is supported by MongoDB Rust Driver](https://togithub.com/prisma/prisma/issues/11899)
- [MongoDB: Error when no database name supplied in connection string](https://togithub.com/prisma/prisma/issues/11909)
- [`Multiple data types found: Array(Array(Array(Double))): 86.2%, Array(Array(Array(Array(Double)))): 13.8% out of 195 sampled entries`](https://togithub.com/prisma/prisma/issues/11912)
##### Prisma Client
- [Unable to use dbgenerated uuid_to_bin for ID field: "Could not figure out an ID in create"](https://togithub.com/prisma/prisma/issues/7010)
- [groupBy is not usable with $transaction](https://togithub.com/prisma/prisma/issues/7918)
- [`InteractiveTransaction`: Middleware param `runInTransaction` set to `false`](https://togithub.com/prisma/prisma/issues/9073)
- [MDBGA: Support MongoDB Atlas Serverless](https://togithub.com/prisma/prisma/issues/9659)
- [Incorrect Typescript type for QueryEvent.timestamp](https://togithub.com/prisma/prisma/issues/10217)
- [Using "then ()" in "interactive Transactions" initiates another transaction](https://togithub.com/prisma/prisma/issues/10615)
- [MDBE: Write usage guide on MongoDB Embedded Documents Support](https://togithub.com/prisma/prisma/issues/11092)
- [MongoDB first request takes ~45s on Windows](https://togithub.com/prisma/prisma/issues/11340)
- [Prisma Client: `.count` does not work with where](https://togithub.com/prisma/prisma/issues/11556)
- [`interactiveTransactions` feature breaks long running transactions](https://togithub.com/prisma/prisma/issues/11565)
- [Go through the existing iTX and explore what needs to be worked on](https://togithub.com/prisma/prisma/issues/11574)
- [Cannot extend PrismaClient class](https://togithub.com/prisma/prisma/issues/11628)
- [MongoDB: add test on TS side for ObjectId arrays `a_ids String[] @db.ObjectId`](https://togithub.com/prisma/prisma/issues/11632)
- [Prisma Client: Fluent API chaining not working for PascalCase columns in 3.9.1](https://togithub.com/prisma/prisma/issues/11641)
- [Interactive transaction: Sequential Prisma Client operations timeout but work when interactive transactions are disabled](https://togithub.com/prisma/prisma/issues/11654)
- [prisma v3.9.1: Get TypeError(read-only and non-configurable data property on the proxy target) when use jest.fn().mockReturnValue.](https://togithub.com/prisma/prisma/issues/11655)
- [Avoid shipping unused intermediary ESM files](https://togithub.com/prisma/prisma/issues/11683)
- [Unable to parse Connection String in Sharded MongoDB](https://togithub.com/prisma/prisma/issues/11684)
- [Prisma Client queries are executed multiple times in `3.9.1`](https://togithub.com/prisma/prisma/issues/11686)
- [Send `prisma` as `driverInfo` to MongoDB](https://togithub.com/prisma/prisma/issues/11855)
- [Fluent API is no longer supported at runtime for mutations](https://togithub.com/prisma/prisma/issues/11861)
#### Credits
Huge thanks to [@andyrichardson](https://togithub.com/andyrichardson), [@xnerhu](https://togithub.com/xnerhu), [@Josh-a-e](https://togithub.com/Josh-a-e), [@dusandz](https://togithub.com/dusandz), [@hyochan](https://togithub.com/hyochan), [@cesconix](https://togithub.com/cesconix), [@benkroeger](https://togithub.com/benkroeger), [@YassinEldeeb](https://togithub.com/YassinEldeeb), [@chenkie](https://togithub.com/chenkie) for helping!
#### 📺 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://www.youtube.com/watch?v=OouLYZDveBU) livestream.
The stream takes place [on YouTube](https://www.youtube.com/watch?v=OouLYZDveBU) on **Thursday, February 03** at **5 pm Berlin | 8 am San Francisco**.
### [`v3.9.2`](https://togithub.com/prisma/prisma/releases/3.9.2)
[Compare Source](https://togithub.com/prisma/prisma/compare/3.9.1...3.9.2)
Today, we are issuing the `3.9.2` patch release.
#### Fixes
- [Prisma Client Fluent API chaining not working for PascalCase columns](https://togithub.com/prisma/prisma/issues/11641)
- [Prisma Client queries are executed multiple times](https://togithub.com/prisma/prisma/issues/11686)
- [prisma v3.9.1: Get TypeError(read-only and non-configurable data property on the proxy target) when use jest.fn().mockReturnValue](https://togithub.com/prisma/prisma/issues/11655)
- [Cannot extend PrismaClient class](https://togithub.com/prisma/prisma/issues/11628)
### [`v3.9.1`](https://togithub.com/prisma/prisma/releases/3.9.1)
[Compare Source](https://togithub.com/prisma/prisma/compare/3.9.0...3.9.1)
Today, we are issuing the `3.9.1` patch release.
#### Fixes
- [`prisma db pull` doesn't read `.env` file and errors with Environment variable not found: DATABASE_URL](https://togithub.com/prisma/prisma/issues/11570)
- [Prisma Client: `.count` does not work with where](https://togithub.com/prisma/prisma/issues/11556)
### [`v3.9.0`](https://togithub.com/prisma/prisma/releases/3.9.0)
[Compare Source](https://togithub.com/prisma/prisma/compare/3.8.1...3.9.0)
Today, we are excited to share the `3.9.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.9.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.9.0) about the release.** 🌟
##### Major improvements and new features
##### Prisma Migrate improvements to troubleshoot migrations
Last year, we released Prisma Migrate for General Availability. Since then, we've gotten feedback from you to understand the challenges you experience building, testing, and deploying migrations.
We're thrilled to announce that we're introducing new CLI commands to improve the experience troubleshooting migrations:
- `prisma migrate diff`
- `prisma db execute`
The `prisma migrate diff` command creates a diff of your database schema, Prisma schema file, or the migration history. All you would 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 return.
As a companion to the `prisma migrate diff`, we also built `prisma db execute` to execute SQL scripts against a database. You can pipe the output from `prisma migrate diff` directly to `prisma db execute`.
Both commands are non-interactive, so it's possible to build many new workflows such as forward and backward migrations with some automation tooling.
Both commands are in Preview, and we are looking forward to learning how they work for you and how we could make them better.
You can learn about them [here](https://www.prisma.io/docs/guides/database/production-troubleshooting#fixing-failed-migrations-with-migrate-diff-and-db-execute) and give us feedback on the [issue](https://togithub.com/prisma/prisma/issues/11514).
##### Preview support for CockroachDB
We are excited to announce [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) support for CockroachDB :tada:
[CockroachDB](https://www.cockroachlabs.com/) is a distributed SQL database that shines in its ability to scale efficiently while maintaining developer agility and reducing operational overhead.
CockroachDB support in Prisma is the product of collaboration with the [Cockroach Labs](https://www.cockroachlabs.com/) team, and with this release you can use Prisma in existing CockroachDB projects with introspection.
- Learn more in the [release blog post](https://www.prisma.io/blog/prisma-preview-cockroach-db-release)
- Try it out with the [getting started guide](https://prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-cockroachdb)
- [Share your feedback](https://togithub.com/prisma/prisma/issues/11542)
- Join us this Thursday for [What's new in Prisma 3.9.0](https://www.youtube.com/watch?v=lqiGj02WVqo) where [Aydrian Howard](https://twitter.com/itsaydrian) from Cockroach Labs will be joining us to discuss CockroachDB and give a demo.
##### Raw query support for MongoDB
Prisma version `3.9.0` introduces raw queries to the MongoDB (Preview) connector. Raw queries help writing queries that Prisma doesn't support yet, such as:
```ts
// To find zero or more documents matching a filter
const result = await prisma.user.findRaw({
filter: { age: { $gt: 25 } },
options: { projection: { _id: false } },
})
// To perform aggregation operations on a collection
await prisma.user.aggregateRaw({
pipeline: [
{ $match: { status: 'registered' } },
{ $group: { _id: '$country', total: { $sum: 1 } } },
],
})
// To run a command against the database
await prisma.$runCommandRaw({
aggregate: 'User',
pipeline: [
{ $match: { name: 'Bob' } },
{ $project: { email: true, _id: false } },
],
explain: false,
})
```
The raw query API for MongoDB differs from Prisma's `$queryRaw` SQL API to handle some low-level differences between databases to give you a better API and developer experience.
Learn more about Prisma's new raw query API and how you can use it in our [documentation](https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#raw-queries-with-mongodb).
##### Concurrency issues with Interactive Transactions
In `3.9.0`, we fixed a [number of issues](https://togithub.com/prisma/prisma/issues/8707) around timeouts and rollbacks when there were concurrent reads and writes.
This is part of the [Interactive Transactions preview release](https://togithub.com/prisma/prisma/issues/8664), so you'll need to enable the `interactiveTransactions` preview feature to enable this feature.
If you experienced timeouts or your interactive transactions weren't working quite as you expected, now's the time to upgrade and give it another go!
Learn more about Interactive Transactions in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/transactions#interactive-transactions-in-preview).
##### Fixes and improvements
##### Prisma Client
- [Make the MongoDB Replica Set Requirement Optional in Development](https://togithub.com/prisma/prisma/issues/8266)
- [Enable raw query support in MongoDB](https://togithub.com/prisma/prisma/issues/8270)
- [interactiveTransactions: 2 concurrent writes to the same row will cause it to hang until expiring](https://togithub.com/prisma/prisma/issues/8707)
- [interactiveTransactions rollback but don't error out if timeout is reached](https://togithub.com/prisma/prisma/issues/9533)
- [PCO: Pass the trace ID through to an SQL comment](https://togithub.com/prisma/prisma/issues/10004)
- [prisma.$transaction: Benchmark produces unexpected results](https://togithub.com/prisma/prisma/issues/10218)
- [Snapshot serializer in CLI tests doesn't replace time durations >= 1s with a placeholder](https://togithub.com/prisma/prisma/issues/10896)
- [@prisma/sdk v3.8.0: Cannot find module 'fs-jetpack'](https://togithub.com/prisma/prisma/issues/11126)
- [Integrate MongoDB raw queries](https://togithub.com/prisma/prisma/issues/11136)
- [Incorrect type for `DMMF.Field.type` field](https://togithub.com/prisma/prisma/issues/11202)
- [Remove internal UDS option and tests from client](https://togithub.com/prisma/prisma/issues/11240)
- [Internal request: have a way to get types string from dmmf](https://togithub.com/prisma/prisma/issues/11295)
##### Prisma Migrate
- [Unhide `cockroachdb` provider and preview feature flag](https://togithub.com/prisma/prisma/issues/10808)
- [Cannot find module 'fs-jetpack' with prisma 3.8.0](https://togithub.com/prisma/prisma/issues/11112)
- [\[CDB\] Test and improve Default Value Introspection](https://togithub.com/prisma/prisma/issues/11167)
- [Migrate command does not create fulltext index \[MySQL\]](https://togithub.com/prisma/prisma/issues/11177)
- [MySQL conversion issues on Windows with version 8.0.28](https://togithub.com/prisma/prisma/issues/11264)
##### Prisma Studio
- [Can't view any models: ENOENT error no such file or directory when the Prisma schema filename is not `schema.prisma`](https://togithub.com/prisma/studio/issues/819)
##### Prisma Engines
- [Update MongoDB to `2.1.0` (latest)](https://togithub.com/prisma/prisma-engines/issues/2596)
##### Credits
Huge thanks to [@dusandz](https://togithub.com/dusandz), [@hyochan](https://togithub.com/hyochan), [@cesconix](https://togithub.com/cesconix), [@benkroeger](https://togithub.com/benkroeger), [@YassinEldeeb](https://togithub.com/YassinEldeeb), [@chenkie](https://togithub.com/chenkie), [@Akxe](https://togithub.com/Akxe), [@safareli](https://togithub.com/safareli) for helping!
##### Change in release cadence
We're making a slight change to our release cadence to every 3 weeks from every 2 weeks.
##### 📺 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://www.youtube.com/watch?v=lqiGj02WVqo) livestream.
The stream takes place [on YouTube](https://www.youtube.com/watch?v=lqiGj02WVqo) on **Thursday, February 03** at **5 pm Berlin | 8 am San Francisco**.
sapphiredev/utilities
### [`v4.3.3`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#433-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators432sapphiredecorators433-2022-03-20)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.3.2...@sapphire/decorators@4.3.3)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.3.2`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#432-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators431sapphiredecorators432-2022-03-20)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.3.1...@sapphire/decorators@4.3.2)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.3.1`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#431-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators430sapphiredecorators431-2022-03-11)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.3.0...@sapphire/decorators@4.3.1)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.3.0`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#430-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators426sapphiredecorators430-2022-03-06)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.6...@sapphire/decorators@4.3.0)
##### Features
- allow module: NodeNext ([#306](https://togithub.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://togithub.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6))
#### [4.2.6](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.5...@sapphire/decorators@4.2.6) (2022-03-01)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
#### [4.2.5](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.4...@sapphire/decorators@4.2.5) (2022-02-18)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
#### [4.2.4](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.3...@sapphire/decorators@4.2.4) (2022-02-15)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
#### [4.2.3](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.2...@sapphire/decorators@4.2.3) (2022-02-11)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
#### [4.2.2](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.1...@sapphire/decorators@4.2.2) (2022-02-07)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
#### [4.2.1](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.0...@sapphire/decorators@4.2.1) (2022-02-06)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.6`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#426-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators425sapphiredecorators426-2022-03-01)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.5...@sapphire/decorators@4.2.6)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.5`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#425-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators424sapphiredecorators425-2022-02-18)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.4...@sapphire/decorators@4.2.5)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.4`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#424-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators423sapphiredecorators424-2022-02-15)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.3...@sapphire/decorators@4.2.4)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.3`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#423-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators422sapphiredecorators423-2022-02-11)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.2...@sapphire/decorators@4.2.3)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.2`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#422-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators421sapphiredecorators422-2022-02-07)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.1...@sapphire/decorators@4.2.2)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.1`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#421-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators420sapphiredecorators421-2022-02-06)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.0...@sapphire/decorators@4.2.1)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
### [`v4.2.0`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#420-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators410sapphiredecorators420-2022-02-03)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.1.0...@sapphire/decorators@4.2.0)
##### Features
- **ts-config:** add multi-config structure ([#281](https://togithub.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://togithub.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37))
### [`v4.1.0`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#410-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators402sapphiredecorators410-2022-01-28)
[Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.0.2...@sapphire/decorators@4.1.0)
##### Features
- change build system to tsup ([#270](https://togithub.com/sapphiredev/utilities/issues/270)) ([365a53a](https://togithub.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8))
#### [4.0.2](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.0.1...@sapphire/decorators@4.0.2) (2022-01-21)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
#### [4.0.1](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.0.0...@sapphire/decorators@4.0.1) (2022-01-21)
**Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)
sapphiredev/framework
### [`v2.4.1`](https://togithub.com/sapphiredev/framework/compare/v2.4.0...v2.4.1)
[Compare Source](https://togithub.com/sapphiredev/framework/compare/v2.4.0...v2.4.1)
### [`v2.4.0`](https://togithub.com/sapphiredev/framework/blob/HEAD/CHANGELOG.md#240-httpsgithubcomsapphiredevframeworkcomparev230v240-2022-02-05)
[Compare Source](https://togithub.com/sapphiredev/framework/compare/v2.3.0...v2.4.0)
##### Features
- **commands:** more types for detailed description ([#372](https://togithub.com/sapphiredev/framework/issues/372)) ([5085644](https://togithub.com/sapphiredev/framework/commit/5085644fa4037c92a1f435e13a6322b1530a3af5))
##### Bug Fixes
- bump dependencies to their latest versions ([3b35c91](https://togithub.com/sapphiredev/framework/commit/3b35c915648ff0fad6dd2eb569e5fe360a655726))
- **message-parser:** do not run commands when the bot has been timed out ([#373](https://togithub.com/sapphiredev/framework/issues/373)) ([760227d](https://togithub.com/sapphiredev/framework/commit/760227d8d23a846bccc5615e4ae9fef832c1abb7))
sapphiredev/type
### [`v2.2.0`](https://togithub.com/sapphiredev/type/blob/HEAD/CHANGELOG.md#220-httpsgithubcomsapphiredevtypecomparev212v220-2022-03-06)
[Compare Source](https://togithub.com/sapphiredev/type/compare/v2.1.2...v2.2.0)
##### Features
- allow module: NodeNext ([#317](https://togithub.com/sapphiredev/type/issues/317)) ([91e72b2](https://togithub.com/sapphiredev/type/commit/91e72b205aedc10a493cc984404fce06e87046a4))
##### Bug Fixes
- remove eslint-ignore comment ([#280](https://togithub.com/sapphiredev/type/issues/280)) ([c466d92](https://togithub.com/sapphiredev/type/commit/c466d92c240c0cca11a88b25108acedc0ba48796))
##### [2.1.2](https://togithub.com/sapphiredev/type/compare/v2.1.1...v2.1.2) (2021-11-06)
##### [2.1.1](https://togithub.com/sapphiredev/type/compare/v2.1.0...v2.1.1) (2021-10-17)
##### Bug Fixes
- allow more node & npm versions in engines field ([2325577](https://togithub.com/sapphiredev/type/commit/232557704ad5f754eac56711ac05ded97a2f4ba8))
typescript-eslint/typescript-eslint (@typescript-eslint/eslint-plugin)
### [`v5.16.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#5160-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5150v5160-2022-03-21)
[Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0)
##### Bug Fixes
- **eslint-plugin:** \[consistent-type-assertions] enforce assertionStyle for `const` assertions ([#4685](https://togithub.com/typescript-eslint/typescript-eslint/issues/4685)) ([8ec05be](https://togithub.com/typescript-eslint/typescript-eslint/commit/8ec05bed0fed0dcd48b087acd5ab5a6132bf3b09))
##### Features
- **eslint-plugin:** \[prefer-optional-chain] support logical with empty object ([#4430](https://togithub.com/typescript-eslint/typescript-eslint/issues/4430)) ([d21cfe0](https://togithub.com/typescript-eslint/typescript-eslint/commit/d21cfe0f4b7d3041948b1b6e0cd56c5ec34b2b3f))
### [`v5.15.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#5150-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5140v5150-2022-03-14)
[Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0)
##### Features
- **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://togithub.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://togithub.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5))
### [`v5.14.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#5140-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5130v5140-2022-03-07)
[Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0)
##### Bug Fixes
- **eslint-plugin:** \[naming-convention] cover case that requires quotes ([#4582](https://togithub.com/typescript-eslint/typescript-eslint/issues/4582)) ([3ea0947](https://togithub.com/typescript-eslint/typescript-eslint/commit/3ea09477debec9f1593e4d3857e153570b488f4d))
- **eslint-plugin:** \[no-misused-promises] factor thenable returning function overload signatures ([#4620](https://togithub.com/typescript-eslint/typescript-eslint/issues/4620)) ([56a09e9](https://togithub.com/typescript-eslint/typescript-eslint/commit/56a09e98f171662d25ae2692be703a8bbbd3a3a5))
- **eslint-plugin:** \[prefer-readonly-parameter-types] handle class sharp private field and
Configuration
📅 Schedule: "before 12pm on Sunday" (UTC).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
[ ] If you want to rebase/retry this PR, click this checkbox.
This PR contains the following updates:
^3.8.1
->^3.11.0
^4.0.2
->^4.3.3
2.3.0
->2.4.1
^2.1.2
->^2.2.0
^16.11.21
->^16.11.26
^5.10.0
->^5.16.0
^5.10.0
->^5.16.0
^0.25.0
->^0.26.1
^1.19.1
->^1.19.2
^8.7.0
->^8.11.0
^4.17.2
->^4.17.3
^4.3.5
->^4.3.6
^3.8.1
->^3.11.0
^10.4.0
->^10.7.0
^4.5.5
->^4.6.2
Release Notes
prisma/prisma
### [`v3.11.0`](https://togithub.com/prisma/prisma/releases/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 this feature in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/composite-types) and don’t hesitate to reach out in [this issue](https://togithub.com/prisma/prisma/issues/8241). ##### MongoDB query logging support In this release, we’ve added the ability to log MongoDB queries. You can enable query logging in the `PrismaClient` constructor: ```ts const prisma = new PrismaClient({ log: [ { emit: 'event', level: 'query', }, ] }) prisma.$on('query', (e) => console.log(e.query)) ``` After enabling query logging, you'll start to see logs that resemble this in your console: ```bash db.User.deleteMany({ _id: ( $in: [ “62261e0b18139c6099ba7097”, ], }, }) db.User.deleteMany({ _id: ( $in: [ “6226277a96069500743edcf9”, ], }, }) ``` The logs output by Prisma have the same format as the `mongosh` console, so you can pipe the queries from your logs directly into your shell. ##### MongoDB introspection update We've updated the type inference behavior for MongoDB on introspection. Prisma samples a field's data to select an appropriate type on introspection. In the past, Prisma picked the type used most often for fields with data with multiple types. However, this could cause problems when retrieving mixed data during runtime and throw exceptions, such as Prisma Studio or in Prisma Client queries. From `3.11.0`, Prisma defaults to the `Json` type to all fields with mixed data types instead. Additionally, Prisma will still show a warning on the console and add a comment to the introspected Prisma schema so it is clear where such cases occur and that you can do something to fix them. ##### Prisma Client logger revamp In `3.11.0`, we’ve rewritten our internal logger to reduce [lock contention](https://en.wikipedia.org/wiki/Lock_\(computer_science\)#:~:text=lock%20contention%3A%20this%20occurs%20whenever,lock%20held%20by%20the%20other.) and enable future features like tracing. This is the first of many upcoming changes to improve the Prisma Client’s throughput, so if you were running into an upper limit on query performance, it’s time to update Prisma Client and give it a try! If you're running into query performance issues, please [open an issue](https://togithub.com/prisma/prisma/issues/new/choose) or [connect with us on Slack](https://slack.prisma.io/). ##### CockroachDB now supports migrations (Preview) We're excited to announce Preview support for migrations for CockroachDB. You can now evolve your Prisma schema and propagate the changes to your database using Prisma Migrate. Give the feature a try and let us know what you think in [this issue](https://togithub.com/prisma/prisma/issues/11542). ##### Detecting state of a diff with `migrate diff` using exit code Prisma version `3.11.0` includes a new `--exit-code` flag to the `migrate diff` command to detect the state of a diff in several ways. You can use the flag as follows: ```bash npx prisma migrate diff --preview-feature \ --exit-code \ --from-[...] \ --to-[...] ``` Here's a list of the default and changed behavior of the error codes: #### Default behavior of exit codes 0: Returned when the diff is empty or non-empty 1: Returned on error #### Changed behavior when --exit-code is used 0: Returned when the diff is empty 1: Returned on error 2: Returned when the diff is non-empty Read about it in the [reference documentation](https://www.prisma.io/docs/reference/api-reference/command-reference#migrate-diff). #### Fixes and improvements ##### Prisma - [Command to export SQL schema](https://togithub.com/prisma/prisma/issues/1992) - [Waiting "too long" to input migration name leads to error message](https://togithub.com/prisma/prisma/issues/7742) - [`db push` with empty `schema.prisma`: `Error: TypeError: Cannot read properties of undefined (reading 'url')`](https://togithub.com/prisma/prisma/issues/9518) - [migrate diff: --{from,to}-schema-datamodel should not error on missing env vars in datasource blocks ](https://togithub.com/prisma/prisma/issues/11544) - [migrate diff: Provide a reliable way to detect empty diffs / migrations](https://togithub.com/prisma/prisma/issues/11566) - [`db execute` cannot resolve SQLite file path from schema](https://togithub.com/prisma/prisma/issues/11626) - [\[MDB\] Implement version and describe RPC calls for the error reporting backend](https://togithub.com/prisma/prisma/issues/11691) - [\[MDB\] Create fields referenced in index definitions as Json to enable display of indexes in datamodel ](https://togithub.com/prisma/prisma/issues/11933) - [MongoDB many to many: `PANIC: called Option::unwrap() on a None`](https://togithub.com/prisma/prisma/issues/11970) ##### Prisma Client - [PANIC in query-engine/connectors/mongodb-query-connector/src/value.rs:185:24not yet implemented: (Json, Json("\[\]"))](https://togithub.com/prisma/prisma/issues/6773) - [Prisma Mongo Panic called `Option::unwrap()` on a `None` value](https://togithub.com/prisma/prisma/issues/8598) - [Better error message for MongoDB replica sets](https://togithub.com/prisma/prisma/issues/8719) - [MongoDB: Using `tlsCAFile` fails](https://togithub.com/prisma/prisma/issues/9072) - [no such file or directory, open '/path/schema.prisma' since 3.1.1](https://togithub.com/prisma/prisma/issues/9435) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs:301:74](https://togithub.com/prisma/prisma/issues/9977) - [`contains` string filter not working with mongoDB](https://togithub.com/prisma/prisma/issues/10267) - [Referential integrity is not preserved when updating foreign key (in "prisma" mode)](https://togithub.com/prisma/prisma/issues/11100) - [PANIC: called `Option::unwrap()` on a `None` value in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:112:74](https://togithub.com/prisma/prisma/issues/11378) - [HasReject not evaluating correctly for per operation handlers](https://togithub.com/prisma/prisma/issues/11403) - [Support MongoDB "query" logging](https://togithub.com/prisma/prisma/issues/11419) - [CONTRIBUTING: document Prisma Client workflow of using local link ](https://togithub.com/prisma/prisma/issues/11828) - [MongoDB findRaw filter problem with ObjectId field.](https://togithub.com/prisma/prisma/issues/11830) - [MongoDB: Better error message for when document does not match the defined schema](https://togithub.com/prisma/prisma/issues/11853) - [Integrate orderBy for composite types](https://togithub.com/prisma/prisma/issues/12038) - [Attempting to do a query in the Prisma Client on a model with a foreign key that has `@map` panics on 3.10.0](https://togithub.com/prisma/prisma/issues/12105) - [Use embedded documents attributes in where clause](https://togithub.com/prisma/prisma/issues/12186) - [`'then' in PrimsaPromise` returns false](https://togithub.com/prisma/prisma/issues/12252) ##### Prisma Migrate - [Detect schema drift helper / `migrate dev --exit-code`](https://togithub.com/prisma/prisma/issues/9707) - [Migrate lock timeout on PlanetScale](https://togithub.com/prisma/prisma/issues/10997) ##### Language tools (e.g. VS Code) - [MongoDB M:N relations get referential actions auto completion suggestions, then does not validate](https://togithub.com/prisma/language-tools/issues/1060) - [Auto Completion: `map` does not exist for M:N in MongoDB](https://togithub.com/prisma/language-tools/issues/1061) - [Autocomplete shows invalid suggestions for composite types](https://togithub.com/prisma/language-tools/issues/1063) - [Suggest auto() in VSCode autocomplete](https://togithub.com/prisma/language-tools/issues/1064) - [Clicking on a MongoDB composite type does not jump to definition](https://togithub.com/prisma/language-tools/issues/1069) ##### Prisma Engines - [Implement order by composites](https://togithub.com/prisma/prisma-engines/issues/2514) - [\[Composites\] Implement `equals` read operation](https://togithub.com/prisma/prisma-engines/issues/2675) - [\[Composites\] Implement `is` read operation](https://togithub.com/prisma/prisma-engines/issues/2676) - [\[Composites\] Implement `isNot` read operation](https://togithub.com/prisma/prisma-engines/issues/2677) - [\[Composites\] Implement `isEmpty` read operation](https://togithub.com/prisma/prisma-engines/issues/2678) - [\[Composites\] Implement `every` read operation](https://togithub.com/prisma/prisma-engines/issues/2679) - [\[Composites\] Implement `some` read operation](https://togithub.com/prisma/prisma-engines/issues/2680) - [\[Composites\] Implement `none` read operation](https://togithub.com/prisma/prisma-engines/issues/2681) #### Credits Huge thanks to [@hayes](https://togithub.com/hayes), [@maddhruv](https://togithub.com/maddhruv), [@jasimon](https://togithub.com/jasimon) for helping! #### 📺 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/2dAtmHuT-30) livestream. The stream takes place [on YouTube](https://youtu.be/2dAtmHuT-30) on **Thursday, March 17** at **5 pm Berlin | 8 am San Francisco**. ### [`v3.10.0`](https://togithub.com/prisma/prisma/releases/3.10.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.9.2...3.10.0) Today, we are excited to share the `3.10.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.10.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.10.0) about the release.** 🌟 #### Major improvements and new features We are working towards a stable release of MongoDB and are shipping lots of improvements. **All the new features and changes in this release therefore only apply to the MongoDB connector.** Take a closer look if you are using the [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) of MongoDB as some of the changes are breaking. ##### Embedded documents support is now in Preview We're super excited to announce that Prisma version `3.10.0` supports reading and modifying embedded documents. Embedded documents will provide access to a new `type` keyword in your Prisma schema that you can use to define composite types. ```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 name String photos Photo[] } type Photo { height Int width Int url String } ``` Given the schema above, you can now read and write to the embedded `photos` array: ```ts // Create a new product with an embedded list of photos const product = await prisma.product.create({ data: { name: "Forest Runners", // Create an embedded list of photos in the product photos: [ { height: 100, width: 200, url: "1.jpg" }, { height: 300, width: 400, url: "2.jpg" }, ], }, }) ``` Best of all, the query is entirely type-safe! This scratches the surface of what's possible with embedded documents. You can read further in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/composite-types). If you run into anything, feel free to [open an issue](https://togithub.com/prisma/prisma/issues/new/choose), and we’ll give you a hand! ##### Introspection of embedded documents is now enabled by default We added Preview support for Introspection of embedded documents in version `3.4.0` and are now activating it for all users. Running `prisma db pull` against your MongoDB database will generate `type` definitions within your Prisma schema. When introspecting your database, you can switch off the depth with `--composite-type-depth=0`, or limit it with, for example, `--composite-type-depth=2`. Feel free to drop your feedback on the feature on [GitHub](https://togithub.com/prisma/prisma/issues/10016). ##### `@default(dbgenerated())` is now replaced with `@default(auto())` The original purpose of `dbgenerated` is to support SQL expressions Prisma doesn’t understand yet. However, MongoDB doesn’t have a concept of default value expressions like SQL does. We took this opportunity to simplify how we handle the default values in MongoDB: ```diff model Post { - id String @id @default(dbgenerated()) @map("_id") @db.ObjectId + id String @id @default(auto()) @map("_id") @db.ObjectId } ``` ##### Many-to-Many relations now require a `references` argument Prisma version `3.10.0` now enforces all arguments in a MongoDB many-to-many relation. This means a `@relation` attribute must define `fields` and `references` arguments on both sides. The `fields` argument must point to a scalar field in the same model, and this scalar field must be an array. The `references` arguments must point to a scalar field in the opposite model, and it must be a singular type of the same base type as the referencing array on the other side. ```diff model Post { id String @id @map("_id") @default(auto()) @db.ObjectId category_ids String[] @db.ObjectId - categories Category[] @relation(fields: [category_ids]) + categories Category[] @relation(fields: [category_ids], references: [id]) } model Category { id String @id @map("_id") @default(auto()) @db.ObjectId post_ids String[] @db.ObjectId - posts Post[] @relation(fields: [post_ids]) + posts Post[] @relation(fields: [post_ids], references: [id]) } ``` ##### `@db.Array(ObjectId)` is now updated to `@db.ObjectId` We've adjusted the Prisma schema format for scalar lists with native types (like lists of Object IDs). This will likely affect those with many-to-many relationships in MongoDB. We made this change to align MongoDB with our existing SQL databases better: ```diff model Post { id String @id @default(auto()) @map("_id") @db.ObjectId - categoryIDs String[] @db.Array(ObjectId) + categoryIDs String[] @db.ObjectId categories Category[] @relation(fields: [categoryIDs], references: [id]) } model Category { id String @id @default(auto()) @map("_id") @db.ObjectId - postIDs String[] @db.Array(ObjectId) + postIDs String[] @db.ObjectId posts Post[] @relation(fields: [postIDs], references: [id]) } ``` #### Fixes and improvements ##### Prisma Migrate - [Ability to create SQL table logic from schema without doing a "migrate"](https://togithub.com/prisma/prisma/issues/6155) - [Improve error on default values when `@db.ObjectId` isn't present](https://togithub.com/prisma/prisma/issues/6429) - [Validator accepts arbitrary properties in `datasource` blocks](https://togithub.com/prisma/prisma/issues/7342) - [Programmatically create a MongoDB database](https://togithub.com/prisma/prisma/issues/8582) - [`prisma init --url` does not like `mongodb+srv://`](https://togithub.com/prisma/prisma/issues/9644) - [Test the error reporting backend with MongoDb](https://togithub.com/prisma/prisma/issues/10528) - [Better Schema validation for MongoDB](https://togithub.com/prisma/prisma/issues/10809) - [`Code 19` and unformatted list output during Re-Introspection](https://togithub.com/prisma/prisma/issues/11025) - [MongoDB Introspection Multiple Types warning message in CLI output does not differentiate models and embedded documents](https://togithub.com/prisma/prisma/issues/11179) - [MongoDB Introspection Embedded Documents do not require `id_` special case](https://togithub.com/prisma/prisma/issues/11180) - [Introspection result `Unsupported("Unknown")` causes schema validation to crash](https://togithub.com/prisma/prisma/issues/11181) - [Confidence Tooling run and result verification for embedded documents](https://togithub.com/prisma/prisma/issues/11182) - [MongoDB Introspection connects to database even when failing with error message that should not require connection to database at all](https://togithub.com/prisma/prisma/issues/11185) - [Change `@db.Array(ObjectId)` to `@db.ObjectId`](https://togithub.com/prisma/prisma/issues/11226) - [Make sure `Unsupported(...)` fields are not rejected on composite types](https://togithub.com/prisma/prisma/issues/11282) - [MongoDB PSL parsing should fail when using `@default(autoincrement())`](https://togithub.com/prisma/prisma/issues/11291) - [Error: \[/root/build/libs/mongodb-schema-describer/src/lib.rs:35:41\] called `Option::unwrap()` on a `None` value ](https://togithub.com/prisma/prisma/issues/11300) - [MongoDB embedded documents Introspection does not give any names to fields with invalid names](https://togithub.com/prisma/prisma/issues/11390) - [Embedded document `_id` of type `ObjectId` are introspected without native type ` @db.ObjectId `](https://togithub.com/prisma/prisma/issues/11396) - ["experimental feature, needs to be enabled"](https://togithub.com/prisma/prisma/issues/11482) - [MongoDB: On ID fields, replace `@default(dbgenerated())` with `@default(auto())`](https://togithub.com/prisma/prisma/issues/11552) - [Implement datamodel parser validations for two-way embedded many-to-many relations on MongoDB](https://togithub.com/prisma/prisma/issues/11553) - [MongoDB: The connection string format and parameters are defined by mongo-rust-driver](https://togithub.com/prisma/prisma/issues/11567) - [`prisma db pull` doesn't read `.env` file and errors with Environment variable not found: DATABASE_URL](https://togithub.com/prisma/prisma/issues/11570) - [\[MDB\] Do not hardcode \_id to ObjectId during Introspection](https://togithub.com/prisma/prisma/issues/11623) - [\[MDB\] Schema validation error on valid composite type](https://togithub.com/prisma/prisma/issues/11625) - [Turn on embedded document Introspection by default](https://togithub.com/prisma/prisma/issues/11797) - [`Model "undefined", field: ...`](https://togithub.com/prisma/prisma/issues/11809) - [MongoDB Introspection does not output how many embedded documents were introspected](https://togithub.com/prisma/prisma/issues/11827) - [Sharded MongoDB connection string is not supported by Prisma Client](https://togithub.com/prisma/prisma/issues/11873) - [Add mongodb 4.2 to tested versions on migrate & introspection](https://togithub.com/prisma/prisma/issues/11884) - [Confirm sharded MongoDB connection string is supported by MongoDB Rust Driver](https://togithub.com/prisma/prisma/issues/11899) - [MongoDB: Error when no database name supplied in connection string](https://togithub.com/prisma/prisma/issues/11909) - [`Multiple data types found: Array(Array(Array(Double))): 86.2%, Array(Array(Array(Array(Double)))): 13.8% out of 195 sampled entries`](https://togithub.com/prisma/prisma/issues/11912) ##### Prisma Client - [Unable to use dbgenerated uuid_to_bin for ID field: "Could not figure out an ID in create"](https://togithub.com/prisma/prisma/issues/7010) - [groupBy is not usable with $transaction](https://togithub.com/prisma/prisma/issues/7918) - [`InteractiveTransaction`: Middleware param `runInTransaction` set to `false`](https://togithub.com/prisma/prisma/issues/9073) - [MDBGA: Support MongoDB Atlas Serverless](https://togithub.com/prisma/prisma/issues/9659) - [Incorrect Typescript type for QueryEvent.timestamp](https://togithub.com/prisma/prisma/issues/10217) - [Using "then ()" in "interactive Transactions" initiates another transaction](https://togithub.com/prisma/prisma/issues/10615) - [MDBE: Write usage guide on MongoDB Embedded Documents Support](https://togithub.com/prisma/prisma/issues/11092) - [MongoDB first request takes ~45s on Windows](https://togithub.com/prisma/prisma/issues/11340) - [Prisma Client: `.count` does not work with where](https://togithub.com/prisma/prisma/issues/11556) - [`interactiveTransactions` feature breaks long running transactions](https://togithub.com/prisma/prisma/issues/11565) - [Go through the existing iTX and explore what needs to be worked on](https://togithub.com/prisma/prisma/issues/11574) - [Cannot extend PrismaClient class](https://togithub.com/prisma/prisma/issues/11628) - [MongoDB: add test on TS side for ObjectId arrays `a_ids String[] @db.ObjectId`](https://togithub.com/prisma/prisma/issues/11632) - [Prisma Client: Fluent API chaining not working for PascalCase columns in 3.9.1](https://togithub.com/prisma/prisma/issues/11641) - [Interactive transaction: Sequential Prisma Client operations timeout but work when interactive transactions are disabled](https://togithub.com/prisma/prisma/issues/11654) - [prisma v3.9.1: Get TypeError(read-only and non-configurable data property on the proxy target) when use jest.fn().mockReturnValue.](https://togithub.com/prisma/prisma/issues/11655) - [Avoid shipping unused intermediary ESM files](https://togithub.com/prisma/prisma/issues/11683) - [Unable to parse Connection String in Sharded MongoDB](https://togithub.com/prisma/prisma/issues/11684) - [Prisma Client queries are executed multiple times in `3.9.1`](https://togithub.com/prisma/prisma/issues/11686) - [Send `prisma` as `driverInfo` to MongoDB](https://togithub.com/prisma/prisma/issues/11855) - [Fluent API is no longer supported at runtime for mutations](https://togithub.com/prisma/prisma/issues/11861) #### Credits Huge thanks to [@andyrichardson](https://togithub.com/andyrichardson), [@xnerhu](https://togithub.com/xnerhu), [@Josh-a-e](https://togithub.com/Josh-a-e), [@dusandz](https://togithub.com/dusandz), [@hyochan](https://togithub.com/hyochan), [@cesconix](https://togithub.com/cesconix), [@benkroeger](https://togithub.com/benkroeger), [@YassinEldeeb](https://togithub.com/YassinEldeeb), [@chenkie](https://togithub.com/chenkie) for helping! #### 📺 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://www.youtube.com/watch?v=OouLYZDveBU) livestream. The stream takes place [on YouTube](https://www.youtube.com/watch?v=OouLYZDveBU) on **Thursday, February 03** at **5 pm Berlin | 8 am San Francisco**. ### [`v3.9.2`](https://togithub.com/prisma/prisma/releases/3.9.2) [Compare Source](https://togithub.com/prisma/prisma/compare/3.9.1...3.9.2) Today, we are issuing the `3.9.2` patch release. #### Fixes - [Prisma Client Fluent API chaining not working for PascalCase columns](https://togithub.com/prisma/prisma/issues/11641) - [Prisma Client queries are executed multiple times](https://togithub.com/prisma/prisma/issues/11686) - [prisma v3.9.1: Get TypeError(read-only and non-configurable data property on the proxy target) when use jest.fn().mockReturnValue](https://togithub.com/prisma/prisma/issues/11655) - [Cannot extend PrismaClient class](https://togithub.com/prisma/prisma/issues/11628) ### [`v3.9.1`](https://togithub.com/prisma/prisma/releases/3.9.1) [Compare Source](https://togithub.com/prisma/prisma/compare/3.9.0...3.9.1) Today, we are issuing the `3.9.1` patch release. #### Fixes - [`prisma db pull` doesn't read `.env` file and errors with Environment variable not found: DATABASE_URL](https://togithub.com/prisma/prisma/issues/11570) - [Prisma Client: `.count` does not work with where](https://togithub.com/prisma/prisma/issues/11556) ### [`v3.9.0`](https://togithub.com/prisma/prisma/releases/3.9.0) [Compare Source](https://togithub.com/prisma/prisma/compare/3.8.1...3.9.0) Today, we are excited to share the `3.9.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.9.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/3.9.0) about the release.** 🌟 ##### Major improvements and new features ##### Prisma Migrate improvements to troubleshoot migrations Last year, we released Prisma Migrate for General Availability. Since then, we've gotten feedback from you to understand the challenges you experience building, testing, and deploying migrations. We're thrilled to announce that we're introducing new CLI commands to improve the experience troubleshooting migrations: - `prisma migrate diff` - `prisma db execute` The `prisma migrate diff` command creates a diff of your database schema, Prisma schema file, or the migration history. All you would 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 return. As a companion to the `prisma migrate diff`, we also built `prisma db execute` to execute SQL scripts against a database. You can pipe the output from `prisma migrate diff` directly to `prisma db execute`. Both commands are non-interactive, so it's possible to build many new workflows such as forward and backward migrations with some automation tooling. Both commands are in Preview, and we are looking forward to learning how they work for you and how we could make them better. You can learn about them [here](https://www.prisma.io/docs/guides/database/production-troubleshooting#fixing-failed-migrations-with-migrate-diff-and-db-execute) and give us feedback on the [issue](https://togithub.com/prisma/prisma/issues/11514). ##### Preview support for CockroachDB We are excited to announce [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) support for CockroachDB :tada: [CockroachDB](https://www.cockroachlabs.com/) is a distributed SQL database that shines in its ability to scale efficiently while maintaining developer agility and reducing operational overhead. CockroachDB support in Prisma is the product of collaboration with the [Cockroach Labs](https://www.cockroachlabs.com/) team, and with this release you can use Prisma in existing CockroachDB projects with introspection. - Learn more in the [release blog post](https://www.prisma.io/blog/prisma-preview-cockroach-db-release) - Try it out with the [getting started guide](https://prisma.io/docs/getting-started/setup-prisma/add-to-existing-project/relational-databases-typescript-cockroachdb) - [Share your feedback](https://togithub.com/prisma/prisma/issues/11542) - Join us this Thursday for [What's new in Prisma 3.9.0](https://www.youtube.com/watch?v=lqiGj02WVqo) where [Aydrian Howard](https://twitter.com/itsaydrian) from Cockroach Labs will be joining us to discuss CockroachDB and give a demo. ##### Raw query support for MongoDB Prisma version `3.9.0` introduces raw queries to the MongoDB (Preview) connector. Raw queries help writing queries that Prisma doesn't support yet, such as: ```ts // To find zero or more documents matching a filter const result = await prisma.user.findRaw({ filter: { age: { $gt: 25 } }, options: { projection: { _id: false } }, }) // To perform aggregation operations on a collection await prisma.user.aggregateRaw({ pipeline: [ { $match: { status: 'registered' } }, { $group: { _id: '$country', total: { $sum: 1 } } }, ], }) // To run a command against the database await prisma.$runCommandRaw({ aggregate: 'User', pipeline: [ { $match: { name: 'Bob' } }, { $project: { email: true, _id: false } }, ], explain: false, }) ``` The raw query API for MongoDB differs from Prisma's `$queryRaw` SQL API to handle some low-level differences between databases to give you a better API and developer experience. Learn more about Prisma's new raw query API and how you can use it in our [documentation](https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#raw-queries-with-mongodb). ##### Concurrency issues with Interactive Transactions In `3.9.0`, we fixed a [number of issues](https://togithub.com/prisma/prisma/issues/8707) around timeouts and rollbacks when there were concurrent reads and writes. This is part of the [Interactive Transactions preview release](https://togithub.com/prisma/prisma/issues/8664), so you'll need to enable the `interactiveTransactions` preview feature to enable this feature. If you experienced timeouts or your interactive transactions weren't working quite as you expected, now's the time to upgrade and give it another go! Learn more about Interactive Transactions in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/transactions#interactive-transactions-in-preview). ##### Fixes and improvements ##### Prisma Client - [Make the MongoDB Replica Set Requirement Optional in Development](https://togithub.com/prisma/prisma/issues/8266) - [Enable raw query support in MongoDB](https://togithub.com/prisma/prisma/issues/8270) - [interactiveTransactions: 2 concurrent writes to the same row will cause it to hang until expiring](https://togithub.com/prisma/prisma/issues/8707) - [interactiveTransactions rollback but don't error out if timeout is reached](https://togithub.com/prisma/prisma/issues/9533) - [PCO: Pass the trace ID through to an SQL comment](https://togithub.com/prisma/prisma/issues/10004) - [prisma.$transaction: Benchmark produces unexpected results](https://togithub.com/prisma/prisma/issues/10218) - [Snapshot serializer in CLI tests doesn't replace time durations >= 1s with a placeholder](https://togithub.com/prisma/prisma/issues/10896) - [@prisma/sdk v3.8.0: Cannot find module 'fs-jetpack'](https://togithub.com/prisma/prisma/issues/11126) - [Integrate MongoDB raw queries](https://togithub.com/prisma/prisma/issues/11136) - [Incorrect type for `DMMF.Field.type` field](https://togithub.com/prisma/prisma/issues/11202) - [Remove internal UDS option and tests from client](https://togithub.com/prisma/prisma/issues/11240) - [Internal request: have a way to get types string from dmmf](https://togithub.com/prisma/prisma/issues/11295) ##### Prisma Migrate - [Unhide `cockroachdb` provider and preview feature flag](https://togithub.com/prisma/prisma/issues/10808) - [Cannot find module 'fs-jetpack' with prisma 3.8.0](https://togithub.com/prisma/prisma/issues/11112) - [\[CDB\] Test and improve Default Value Introspection](https://togithub.com/prisma/prisma/issues/11167) - [Migrate command does not create fulltext index \[MySQL\]](https://togithub.com/prisma/prisma/issues/11177) - [MySQL conversion issues on Windows with version 8.0.28](https://togithub.com/prisma/prisma/issues/11264) ##### Prisma Studio - [Can't view any models: ENOENT error no such file or directory when the Prisma schema filename is not `schema.prisma`](https://togithub.com/prisma/studio/issues/819) ##### Prisma Engines - [Update MongoDB to `2.1.0` (latest)](https://togithub.com/prisma/prisma-engines/issues/2596) ##### Credits Huge thanks to [@dusandz](https://togithub.com/dusandz), [@hyochan](https://togithub.com/hyochan), [@cesconix](https://togithub.com/cesconix), [@benkroeger](https://togithub.com/benkroeger), [@YassinEldeeb](https://togithub.com/YassinEldeeb), [@chenkie](https://togithub.com/chenkie), [@Akxe](https://togithub.com/Akxe), [@safareli](https://togithub.com/safareli) for helping! ##### Change in release cadence We're making a slight change to our release cadence to every 3 weeks from every 2 weeks. ##### 📺 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://www.youtube.com/watch?v=lqiGj02WVqo) livestream. The stream takes place [on YouTube](https://www.youtube.com/watch?v=lqiGj02WVqo) on **Thursday, February 03** at **5 pm Berlin | 8 am San Francisco**.sapphiredev/utilities
### [`v4.3.3`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#433-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators432sapphiredecorators433-2022-03-20) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.3.2...@sapphire/decorators@4.3.3) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.3.2`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#432-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators431sapphiredecorators432-2022-03-20) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.3.1...@sapphire/decorators@4.3.2) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.3.1`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#431-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators430sapphiredecorators431-2022-03-11) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.3.0...@sapphire/decorators@4.3.1) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.3.0`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#430-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators426sapphiredecorators430-2022-03-06) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.6...@sapphire/decorators@4.3.0) ##### Features - allow module: NodeNext ([#306](https://togithub.com/sapphiredev/utilities/issues/306)) ([9dc6dd6](https://togithub.com/sapphiredev/utilities/commit/9dc6dd619efab879bb2b0b3c9e64304e10a67ed6)) #### [4.2.6](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.5...@sapphire/decorators@4.2.6) (2022-03-01) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) #### [4.2.5](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.4...@sapphire/decorators@4.2.5) (2022-02-18) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) #### [4.2.4](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.3...@sapphire/decorators@4.2.4) (2022-02-15) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) #### [4.2.3](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.2...@sapphire/decorators@4.2.3) (2022-02-11) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) #### [4.2.2](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.1...@sapphire/decorators@4.2.2) (2022-02-07) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) #### [4.2.1](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.0...@sapphire/decorators@4.2.1) (2022-02-06) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.6`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#426-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators425sapphiredecorators426-2022-03-01) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.5...@sapphire/decorators@4.2.6) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.5`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#425-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators424sapphiredecorators425-2022-02-18) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.4...@sapphire/decorators@4.2.5) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.4`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#424-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators423sapphiredecorators424-2022-02-15) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.3...@sapphire/decorators@4.2.4) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.3`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#423-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators422sapphiredecorators423-2022-02-11) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.2...@sapphire/decorators@4.2.3) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.2`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#422-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators421sapphiredecorators422-2022-02-07) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.1...@sapphire/decorators@4.2.2) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.1`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#421-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators420sapphiredecorators421-2022-02-06) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.2.0...@sapphire/decorators@4.2.1) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) ### [`v4.2.0`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#420-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators410sapphiredecorators420-2022-02-03) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.1.0...@sapphire/decorators@4.2.0) ##### Features - **ts-config:** add multi-config structure ([#281](https://togithub.com/sapphiredev/utilities/issues/281)) ([b5191d7](https://togithub.com/sapphiredev/utilities/commit/b5191d7f2416dc5838590c4ff221454925553e37)) ### [`v4.1.0`](https://togithub.com/sapphiredev/utilities/blob/HEAD/packages/decorators/CHANGELOG.md#410-httpsgithubcomsapphiredevutilitiescomparesapphiredecorators402sapphiredecorators410-2022-01-28) [Compare Source](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.0.2...@sapphire/decorators@4.1.0) ##### Features - change build system to tsup ([#270](https://togithub.com/sapphiredev/utilities/issues/270)) ([365a53a](https://togithub.com/sapphiredev/utilities/commit/365a53a5517a01a0926cf28a83c96b63f32ed9f8)) #### [4.0.2](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.0.1...@sapphire/decorators@4.0.2) (2022-01-21) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators) #### [4.0.1](https://togithub.com/sapphiredev/utilities/compare/@sapphire/decorators@4.0.0...@sapphire/decorators@4.0.1) (2022-01-21) **Note:** Version bump only for package [@sapphire/decorators](https://togithub.com/sapphire/decorators)sapphiredev/framework
### [`v2.4.1`](https://togithub.com/sapphiredev/framework/compare/v2.4.0...v2.4.1) [Compare Source](https://togithub.com/sapphiredev/framework/compare/v2.4.0...v2.4.1) ### [`v2.4.0`](https://togithub.com/sapphiredev/framework/blob/HEAD/CHANGELOG.md#240-httpsgithubcomsapphiredevframeworkcomparev230v240-2022-02-05) [Compare Source](https://togithub.com/sapphiredev/framework/compare/v2.3.0...v2.4.0) ##### Features - **commands:** more types for detailed description ([#372](https://togithub.com/sapphiredev/framework/issues/372)) ([5085644](https://togithub.com/sapphiredev/framework/commit/5085644fa4037c92a1f435e13a6322b1530a3af5)) ##### Bug Fixes - bump dependencies to their latest versions ([3b35c91](https://togithub.com/sapphiredev/framework/commit/3b35c915648ff0fad6dd2eb569e5fe360a655726)) - **message-parser:** do not run commands when the bot has been timed out ([#373](https://togithub.com/sapphiredev/framework/issues/373)) ([760227d](https://togithub.com/sapphiredev/framework/commit/760227d8d23a846bccc5615e4ae9fef832c1abb7))sapphiredev/type
### [`v2.2.0`](https://togithub.com/sapphiredev/type/blob/HEAD/CHANGELOG.md#220-httpsgithubcomsapphiredevtypecomparev212v220-2022-03-06) [Compare Source](https://togithub.com/sapphiredev/type/compare/v2.1.2...v2.2.0) ##### Features - allow module: NodeNext ([#317](https://togithub.com/sapphiredev/type/issues/317)) ([91e72b2](https://togithub.com/sapphiredev/type/commit/91e72b205aedc10a493cc984404fce06e87046a4)) ##### Bug Fixes - remove eslint-ignore comment ([#280](https://togithub.com/sapphiredev/type/issues/280)) ([c466d92](https://togithub.com/sapphiredev/type/commit/c466d92c240c0cca11a88b25108acedc0ba48796)) ##### [2.1.2](https://togithub.com/sapphiredev/type/compare/v2.1.1...v2.1.2) (2021-11-06) ##### [2.1.1](https://togithub.com/sapphiredev/type/compare/v2.1.0...v2.1.1) (2021-10-17) ##### Bug Fixes - allow more node & npm versions in engines field ([2325577](https://togithub.com/sapphiredev/type/commit/232557704ad5f754eac56711ac05ded97a2f4ba8))typescript-eslint/typescript-eslint (@typescript-eslint/eslint-plugin)
### [`v5.16.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#5160-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5150v5160-2022-03-21) [Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) ##### Bug Fixes - **eslint-plugin:** \[consistent-type-assertions] enforce assertionStyle for `const` assertions ([#4685](https://togithub.com/typescript-eslint/typescript-eslint/issues/4685)) ([8ec05be](https://togithub.com/typescript-eslint/typescript-eslint/commit/8ec05bed0fed0dcd48b087acd5ab5a6132bf3b09)) ##### Features - **eslint-plugin:** \[prefer-optional-chain] support logical with empty object ([#4430](https://togithub.com/typescript-eslint/typescript-eslint/issues/4430)) ([d21cfe0](https://togithub.com/typescript-eslint/typescript-eslint/commit/d21cfe0f4b7d3041948b1b6e0cd56c5ec34b2b3f)) ### [`v5.15.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#5150-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5140v5150-2022-03-14) [Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) ##### Features - **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://togithub.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://togithub.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) ### [`v5.14.0`](https://togithub.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#5140-httpsgithubcomtypescript-eslinttypescript-eslintcomparev5130v5140-2022-03-07) [Compare Source](https://togithub.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) ##### Bug Fixes - **eslint-plugin:** \[naming-convention] cover case that requires quotes ([#4582](https://togithub.com/typescript-eslint/typescript-eslint/issues/4582)) ([3ea0947](https://togithub.com/typescript-eslint/typescript-eslint/commit/3ea09477debec9f1593e4d3857e153570b488f4d)) - **eslint-plugin:** \[no-misused-promises] factor thenable returning function overload signatures ([#4620](https://togithub.com/typescript-eslint/typescript-eslint/issues/4620)) ([56a09e9](https://togithub.com/typescript-eslint/typescript-eslint/commit/56a09e98f171662d25ae2692be703a8bbbd3a3a5)) - **eslint-plugin:** \[prefer-readonly-parameter-types] handle class sharp private field andConfiguration
📅 Schedule: "before 12pm on Sunday" (UTC).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by WhiteSource Renovate. View repository job log here.