prisma/prisma
### [`v4.1.0`](https://togithub.com/prisma/prisma/releases/tag/4.1.0)
[Compare Source](https://togithub.com/prisma/prisma/compare/4.0.0...4.1.0)
π **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v4.1.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/4.1.0) about the release.** π
#### Upgrading to Prisma 4
In case you missed it, we held a [livestream](https://www.youtube.com/watch?v=FSjkBrfaoEY) last week and walked through issues you may run into while upgrading to [Prisma 4](https://togithub.com/prisma/prisma/releases/tag/4.0.0) and how to fix them!
#### Major improvements
##### Ordering by nulls first and last support (Preview)
In this release, we're adding support for choosing how to sort null values in a query.
To get started, enable the `orderByNulls` [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) feature flag in your Prisma schema:
```prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["orderByNulls"]
}
```
Next, run `prisma generate` to re-generate Prisma Client. You will now have new fields you can now use to order null values:
```ts
await prisma.post.findMany({
orderBy: {
updatedAt: {
sort: 'asc',
nulls: 'last'
},
},
})
```
Learn more in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#sort-with-null-records-first-or-last) and don't hesitate to share your feedback in [this issue](https://togithub.com/prisma/prisma/issues/14377).
##### Fixed memory leaks and CPU usage in Prisma Client
In this release, we've fixed the following issues experienced when setting up and tearing down Prisma Client while running tests:
1. Prisma Client now correctly releases memory on Prisma Client instances that are no longer being used. Learn more in this [GitHub issue](https://togithub.com/prisma/prisma/issues/8989)
2. Reduced CPU usage spikes when disconnecting Prisma Client instances while using Prisma Client. You can learn more in this [GitHub issue](https://togithub.com/prisma/prisma/issues/12516)
These fixes will allow you to run your tests a little faster!
##### Prisma Studio improvements
We're refining the experience when working with Prisma studio with the following changes:
1. An always visible filter panel and functionality to clear **all** filters at once
![](https://i.imgur.com/QXzdJrZ.png)
2. Improved relationship model view with more visible buttons
![](https://i.imgur.com/MTDWnDK.png)
Let us know what you think, and in the event, you run into any issues, please create a [GitHub issue](https://togithub.com/prisma/studio/issues)
#### Fixes and improvements
##### Prisma
- [Formatter doesn't allow comments on consecutive indices](https://togithub.com/prisma/prisma/issues/11455)
- [Internal: reformatter is not idempotent](https://togithub.com/prisma/prisma/issues/12726)
- [`prisma format` strips comments on block level attributes](https://togithub.com/prisma/prisma/issues/13471)
- [Reformatter crash in relation code](https://togithub.com/prisma/prisma/issues/13742)
- [Formatter crashes on arbitrary blocks ](https://togithub.com/prisma/prisma/issues/13992)
- [`prisma --version` crashes if `openssl` isn't properly installed](https://togithub.com/prisma/prisma/issues/14014)
- [Rename 'getVersion' to 'getEngineVersion' in `@prisma/internals`](https://togithub.com/prisma/prisma/issues/14055)
- [BigInt with a default value cause duplicates in all migrations](https://togithub.com/prisma/prisma/issues/14063)
- [Formatter: thread 'main' panicked at 'not yet implemented'](https://togithub.com/prisma/prisma/issues/14090)
- [Mongodb introspection fails with "called `Option::unwrap()` on a `None` value"](https://togithub.com/prisma/prisma/issues/14135)
- [PSL should support inline `//` comments in the generator and datasource blocks](https://togithub.com/prisma/prisma/issues/14171)
- [Unable to use native database types with Prisma and CockroachDB](https://togithub.com/prisma/prisma/issues/14176)
##### Prisma Client
- [High permanent CPU usage after calling $disconnect on a client that executed an interactive transaction before (v3.9.0+)](https://togithub.com/prisma/prisma/issues/12516)
- [Slow Tests](https://togithub.com/prisma/prisma/issues/13092)
- [`prisma generate`: Non-functional debounce mechanism for watch mode](https://togithub.com/prisma/prisma/issues/13677)
- [Unknown error in SQLite Connector migrating from Prisma 3.x to 4.0.0 on ARM/M1 machines](https://togithub.com/prisma/prisma/issues/14057)
- [macOS 12 sometimes kills Node.js process when loading the QE library](https://togithub.com/prisma/prisma/issues/14058)
##### Prisma Migrate
- [migrate-cli: do not override RUST_LOG from the environment](https://togithub.com/prisma/prisma/issues/13931)
- [Incorrect migration creates on sql server when index deleted](https://togithub.com/prisma/prisma/issues/14051)
- [Float cause duplicate alter table in all migrations](https://togithub.com/prisma/prisma/issues/14052)
- [db error: ERROR: cannot drop view geography_columns because extension postgis requires it](https://togithub.com/prisma/prisma/issues/14182)
##### Language tools (e.g. VS Code)
- [Check when `@id` is suggested and fix](https://togithub.com/prisma/language-tools/issues/1084)
- [Implement a code action adding a unique constraint to a relation](https://togithub.com/prisma/language-tools/issues/1181)
- [Potential pipeline π₯ of language-tools with versioning change of `@prisma/engines`](https://togithub.com/prisma/language-tools/issues/1184)
- [Cannot add comments to my @@unique constraints](https://togithub.com/prisma/language-tools/issues/1186)
##### [@prisma/engines](https://togithub.com/prisma/engines) npm package
- [Share build logic with `prisma/prisma`](https://togithub.com/prisma/engines-wrapper/issues/225)
#### Credits
Huge thanks to [@shian15810](https://togithub.com/shian15810), [@zifeo](https://togithub.com/zifeo), [@lodi-g](https://togithub.com/lodi-g), [@Gnucki](https://togithub.com/Gnucki), [@apriil15](https://togithub.com/apriil15) for helping!
#### πΌ We're hiring!
If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.
We're looking for a [Technical Support Engineer](https://grnh.se/ff0d8a702us) and [Back-end Engineer: Prisma Data Platform](https://grnh.se/45afe7982us).
Feel free to read the job descriptions and apply using the links provided.
#### πΊ Join us for another "What's new in Prisma" livestream
Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/R_nVzarAOUM) livestream.
The stream takes place [on YouTube](https://youtu.be/R_nVzarAOUM) on **Thursday, July 19** at **5 pm Berlin | 8 am San Francisco**.
Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, click this checkbox.
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
4.0.0
->4.1.0
Release Notes
prisma/prisma
### [`v4.1.0`](https://togithub.com/prisma/prisma/releases/tag/4.1.0) [Compare Source](https://togithub.com/prisma/prisma/compare/4.0.0...4.1.0) π **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v4.1.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/4.1.0) about the release.** π #### Upgrading to Prisma 4 In case you missed it, we held a [livestream](https://www.youtube.com/watch?v=FSjkBrfaoEY) last week and walked through issues you may run into while upgrading to [Prisma 4](https://togithub.com/prisma/prisma/releases/tag/4.0.0) and how to fix them! #### Major improvements ##### Ordering by nulls first and last support (Preview) In this release, we're adding support for choosing how to sort null values in a query. To get started, enable the `orderByNulls` [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) feature flag in your Prisma schema: ```prisma generator client { provider = "prisma-client-js" previewFeatures = ["orderByNulls"] } ``` Next, run `prisma generate` to re-generate Prisma Client. You will now have new fields you can now use to order null values: ```ts await prisma.post.findMany({ orderBy: { updatedAt: { sort: 'asc', nulls: 'last' }, }, }) ``` Learn more in [our documentation](https://www.prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#sort-with-null-records-first-or-last) and don't hesitate to share your feedback in [this issue](https://togithub.com/prisma/prisma/issues/14377). ##### Fixed memory leaks and CPU usage in Prisma Client In this release, we've fixed the following issues experienced when setting up and tearing down Prisma Client while running tests: 1. Prisma Client now correctly releases memory on Prisma Client instances that are no longer being used. Learn more in this [GitHub issue](https://togithub.com/prisma/prisma/issues/8989) 2. Reduced CPU usage spikes when disconnecting Prisma Client instances while using Prisma Client. You can learn more in this [GitHub issue](https://togithub.com/prisma/prisma/issues/12516) These fixes will allow you to run your tests a little faster! ##### Prisma Studio improvements We're refining the experience when working with Prisma studio with the following changes: 1. An always visible filter panel and functionality to clear **all** filters at once ![](https://i.imgur.com/QXzdJrZ.png) 2. Improved relationship model view with more visible buttons ![](https://i.imgur.com/MTDWnDK.png) Let us know what you think, and in the event, you run into any issues, please create a [GitHub issue](https://togithub.com/prisma/studio/issues) #### Fixes and improvements ##### Prisma - [Formatter doesn't allow comments on consecutive indices](https://togithub.com/prisma/prisma/issues/11455) - [Internal: reformatter is not idempotent](https://togithub.com/prisma/prisma/issues/12726) - [`prisma format` strips comments on block level attributes](https://togithub.com/prisma/prisma/issues/13471) - [Reformatter crash in relation code](https://togithub.com/prisma/prisma/issues/13742) - [Formatter crashes on arbitrary blocks ](https://togithub.com/prisma/prisma/issues/13992) - [`prisma --version` crashes if `openssl` isn't properly installed](https://togithub.com/prisma/prisma/issues/14014) - [Rename 'getVersion' to 'getEngineVersion' in `@prisma/internals`](https://togithub.com/prisma/prisma/issues/14055) - [BigInt with a default value cause duplicates in all migrations](https://togithub.com/prisma/prisma/issues/14063) - [Formatter: thread 'main' panicked at 'not yet implemented'](https://togithub.com/prisma/prisma/issues/14090) - [Mongodb introspection fails with "called `Option::unwrap()` on a `None` value"](https://togithub.com/prisma/prisma/issues/14135) - [PSL should support inline `//` comments in the generator and datasource blocks](https://togithub.com/prisma/prisma/issues/14171) - [Unable to use native database types with Prisma and CockroachDB](https://togithub.com/prisma/prisma/issues/14176) ##### Prisma Client - [High permanent CPU usage after calling $disconnect on a client that executed an interactive transaction before (v3.9.0+)](https://togithub.com/prisma/prisma/issues/12516) - [Slow Tests](https://togithub.com/prisma/prisma/issues/13092) - [`prisma generate`: Non-functional debounce mechanism for watch mode](https://togithub.com/prisma/prisma/issues/13677) - [Unknown error in SQLite Connector migrating from Prisma 3.x to 4.0.0 on ARM/M1 machines](https://togithub.com/prisma/prisma/issues/14057) - [macOS 12 sometimes kills Node.js process when loading the QE library](https://togithub.com/prisma/prisma/issues/14058) ##### Prisma Migrate - [migrate-cli: do not override RUST_LOG from the environment](https://togithub.com/prisma/prisma/issues/13931) - [Incorrect migration creates on sql server when index deleted](https://togithub.com/prisma/prisma/issues/14051) - [Float cause duplicate alter table in all migrations](https://togithub.com/prisma/prisma/issues/14052) - [db error: ERROR: cannot drop view geography_columns because extension postgis requires it](https://togithub.com/prisma/prisma/issues/14182) ##### Language tools (e.g. VS Code) - [Check when `@id` is suggested and fix](https://togithub.com/prisma/language-tools/issues/1084) - [Implement a code action adding a unique constraint to a relation](https://togithub.com/prisma/language-tools/issues/1181) - [Potential pipeline π₯ of language-tools with versioning change of `@prisma/engines`](https://togithub.com/prisma/language-tools/issues/1184) - [Cannot add comments to my @@unique constraints](https://togithub.com/prisma/language-tools/issues/1186) ##### [@prisma/engines](https://togithub.com/prisma/engines) npm package - [Share build logic with `prisma/prisma`](https://togithub.com/prisma/engines-wrapper/issues/225) #### Credits Huge thanks to [@shian15810](https://togithub.com/shian15810), [@zifeo](https://togithub.com/zifeo), [@lodi-g](https://togithub.com/lodi-g), [@Gnucki](https://togithub.com/Gnucki), [@apriil15](https://togithub.com/apriil15) for helping! #### πΌ We're hiring! If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you. We're looking for a [Technical Support Engineer](https://grnh.se/ff0d8a702us) and [Back-end Engineer: Prisma Data Platform](https://grnh.se/45afe7982us). Feel free to read the job descriptions and apply using the links provided. #### πΊ Join us for another "What's new in Prisma" livestream Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtu.be/R_nVzarAOUM) livestream. The stream takes place [on YouTube](https://youtu.be/R_nVzarAOUM) on **Thursday, July 19** at **5 pm Berlin | 8 am San Francisco**.Configuration
π Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.