Prisma 2.4.0stable Released Aug 04, 2020
Impact Score: 5/10

Prisma 2.4.0 โ€” Release Notes & Engineering Impact

Source available โ€” automated, not human-reviewed

Component: prisma ยท Channel: stable. Automated analysis, not a compatibility certification. How this works.

Analysis updated: 2026-11-01.

Compatibility not verified โ€” check source notes
$ npm install --save-dev --save-exact [email protected]
๐Ÿ“„ .MD
โšก Executive Summary (TL;DR)

Prisma 2.4.0. Source highlight: Today, we are issuing the `2.4.0` stable release.

Who Does This Impact? (Role-Based Analysis)

๐Ÿ’ป Software Engineers & Devs

Check the source notes against the package and APIs you use before upgrading.

๐Ÿ“Š Product & Engineering Leads

Use the documented changes to assess relevance to your product; release frequency alone is not a quality measure.

โš™๏ธ DevOps & Security

Verify the target version, runtime requirements and rollback procedure in the official documentation.

โœจ New Features & Capabilities (6)

  • Added ability to view and edit JSON fields
  • In version `2.1.0` we introduced two experimental features, namely `connectOrCreate` and `transactionApi`.
  • In `2.2.0` we introduced `aggregateApi`.
  • In `2.3.0` we introduced `middlewares` and the `distinctApi`.
  • Supported feature combination coverage (MySQL + SQLite)
  • Add support for /* Prisma */ syntax highlighting

โšก Performance & Enhancements (1)

  • Improve error for nonexistent table

๐Ÿ”ง Bug Fixes & Patches (4)

  • Extension only sub-patch release process
  • A patch release for CLI should be based on a tag and not master
  • Streamline debugging of language server before published to npm
  • Recognize usage of experimentalFeatures and give warning and quick-fix
๐Ÿ“„ View Raw Release Notes (Original Developer Log)
Today, we are issuing the `2.4.0` stable release. ๐ŸŒŸ **Help us spread the word about Prisma by starring the repo โ˜๏ธ or [tweeting about the release](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20Prisma%20release%202.4.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.4.0)** ๐ŸŒŸ ## Major improvements ### Order by multiple fields A long-awaited feature - the ability to order by multiple fields in Prisma Client is finally here! Until now you could only order by a single scalar field of a model. The API design however was already prepared for ordering multiple fields with the object syntax we have. Instead of just one property, that `orderBy` object can now have as many fields as you want! The order of the fields hereby determines the order of the returned list (see example below). > **Note**: As this is an _incremental_ change in the API, we introduce this feature without a feature flag. You can use it like so: ```ts // order by `age` descending and then by `name` ascending const users = await prisma.user.findMany({ orderBy: { age: 'desc', name: 'asc' } }) ``` As mentioned by the comment, the returned objects in `users` are ordered _first_ by `age` (descending), and _then_ by `name` (ascending). ๐Ÿ“š **Documentation**: [Sort on multiple fields](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/sorting#sort-user-by-multiple-fields---email-and-role) ### Top-level Client Methods: `$` dollar prefix for top-level Prisma Client methods In recent versions, we introduced a couple of top-level methods in Prisma Client (e.g. `prisma.transaction()` and `prisma.use()`) in _preview_ mode. The immediate feedback was that the denylist for model names grew - which [breaks Prisma schemas](https://github.com/prisma/prisma/issues/3049) where a model is called `Transaction`, `transaction`, `use`, or `Use`. And the list goes on... In order to have a future-proof API, that allows maximum expressibility in terms of model names, we decided to prefix all non-query methods with a dollar sign `$`. That means Prisma Client will from now on ship with the following methods: #### Pre-existing - `$disconnect` - `$connect` - `$on` - `$queryRaw` - `$executeRaw` #### Still in preview - `$use` - `$transaction` The preview methods have already been renamed, the pre-existing methods like `connect` are still available, you just get a deprecation warning. They will be available for a few more releases with an alias, so no hurry to update them yet. <!-- > **Note**: The mental model here now becomes very simple - everything with a `$` comes from Prisma, everything without a `$` (e.g. `prisma.user.findMany()`) comes from your schema. --> ### Updates in Prisma Studio With this release, we shipped a number of improvements for Prisma Studio: - Refreshed design - Moved the _Reload_ button from the right of the databrowser to the left - Moved the _Pending Actions_ bar from the bottom of the databrowser to the top right - Removed the sidebar; to open a model, you can now press the _New Tab_ button on the top - Removed the code editor - Removed the tree view - Added ability to view and edit JSON fields Try out Prisma Studio in the [online demo](http://prisma.studio/) or in your Prisma project by running: ``` npx prisma studio --experimental ``` ## Preview features ### Changes to `middlewares` and `transactionApi` As mentioned above, we ar changing the names of some the top-level Prisma Client methods. This affects the two preview features [`middlewares`](https://github.com/prisma/prisma/issues/3107) and [`transactionApi`](https://github.com/prisma/prisma/issues/3104). ##### `middlewares` You still need to enable the preview feature via the `generator` block in your Prisma schema to access it: ```prisma generator client { provider = "prisma-client-js" previewFeatures = ["middlewares"] } ``` _Before_ ```ts prisma.on() ``` _After_ ```ts prisma.$on() ``` ##### `transactionApi` You still need to enable the preview feature via the `generator` block in your Prisma schema to access it: ```prisma generator client { provider = "prisma-client-js" previewFeatures = ["transactionApi"] } ``` _Before_ ```ts prisma.transaction() ``` _After_ ```ts prisma.$transaction() ``` ### Already existing preview features from `2.1.0`, `2.2.0`, and `2.3.0` Just a quick reminder: - In version [`2.1.0`](https://github.com/prisma/prisma/releases/tag/2.1.0) we introduced two experimental features, namely `connectOrCreate` and `transactionApi`. - In [`2.2.0`](https://github.com/prisma/prisma/releases/tag/2.2.0) we introduced `aggregateApi`. - In [`2.3.0`](https://github.com/prisma/prisma/releases/tag/2.2.0) we introduced `middlewares` and the `distinctApi`. In case they're useful for you, please give them a try and [share your feedback](https://github.com/prisma/prisma/issues/3108)! These features remain in preview in this release. ## ๐ŸŒŸ Help us spread the word about Prisma To help spread the word about Prisma, we'd very much appreciate if you would **star this repo** ๐ŸŒŸ And if you're excited about the features in this week's release, then help us and [share it on Twitter](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20Prisma%20release%202.4.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.4.0). ## Fixes and improvements ### [`prisma`](https://github.com/prisma/prisma) - [[Introspection] Do not print `@default("")` for String fields](https://github.com/prisma/prisma/issues/1995) - [Prisma introspect: extra field for self-relations](https://github.com/prisma/prisma/issues/2313) - [Prisma 1 CLI (for versions smaller than 1.34) and Prisma 2.0 CLI share the same command](https://github.com/prisma/prisma/issues/2433) - [Clarify schema comments](https://github.com/prisma/prisma/issues/2546) - [`CreateInput` and `UpdateInput` have different typings for optional relations](https://github.com/prisma/prisma/issues/2839) - [Loss of precision on Float fields](https://github.com/prisma/prisma/issues/2903) - [pgbouncer=true flag not working as expected with a relation and enums on both sides of the relations](https://github.com/prisma/prisma/issues/2907) - [Relation + enums + pgbouncer fails with a ConnectorError](https://github.com/prisma/prisma/issues/2921) - [Implicit m-n relations have an extra `@relation` field after introspection](https://github.com/prisma/prisma/issues/2947) - [Supported feature combination coverage (MySQL + SQLite)](https://github.com/prisma/prisma/issues/2948) - [Support setting a timeout for SQLite](https://github.com/prisma/prisma/issues/2955) - [CLI won't run in AWS Lambda](https://github.com/prisma/prisma/issues/2980) - [Prisma Client is generated twice when `output` is specified on `generator`](https://github.com/prisma/prisma/issues/3036) - [[Re-Introspection] `@@map` and `@map` with argument `name` loses the `name` after re-introspection](https://github.com/prisma/prisma/issues/3053) - [Surface schema validation errors during Re-Introspection and change flow](https://github.com/prisma/prisma/issues/3082) - [Validate uniqueness of names of indexes on databases which doesn't allow two indexes with the same name](https://github.com/prisma/prisma/issues/3099) - [[Re-Introspection] Enum with `@map` will get option commented if it invalid without map](https://github.com/prisma/prisma/issues/3119) - [optional one-to-many relationship: none/every filters: Incorrect SQL generated](https://github.com/prisma/prisma/issues/3141) - [Problems with middleware for tracing](https://github.com/prisma/prisma/issues/3148) - [Self-referential one-to-one relationship. Incorrect SQL for `{ where: { non_fk_field: null } }`](https://github.com/prisma/prisma/issues/3153) ### [`prisma-client-js`](https://github.com/prisma/prisma-client-js) - [Ability to sort results by multiple attributes](https://github.com/prisma/prisma-client-js/issues/702) - [Upsert should allow where clause with only undefined](https://github.com/prisma/prisma-client-js/issues/781) - [AWS Lambda: Unknown error in Prisma Client](https://github.com/prisma/prisma-client-js/issues/789) ### [`migrate`](https://github.com/prisma/migrate) - [Migration ID timestamp issue](https://github.com/prisma/migrate/issues/536) ### [`language-tools`](https://github.com/prisma/language-tools) - [Add support for /* Prisma */ syntax highlighting](https://github.com/prisma/language-tools/issues/18) - [Extension only release automation](https://github.com/prisma/language-tools/issues/143) - [Publish Insider extension on every commit ](https://github.com/prisma/language-tools/issues/224) - [Extension only sub-patch release process](https://github.com/prisma/language-tools/issues/240) - [A patch release for CLI should be based on a tag and not master](https://github.com/prisma/language-tools/issues/246) - [Dev instructions for working with language server are outdated.](https://github.com/prisma/language-tools/issues/285) - [Streamline debugging of language server before published to npm](https://github.com/prisma/language-tools/issues/301) - [Implement workaround for hanging types in LSP](https://github.com/prisma/language-tools/issues/315) - [Run e2e tests before publishing on mac, windows as well](https://github.com/prisma/language-tools/issues/326) - [Blank lines removed in model one by one in VS Code](https://github.com/prisma/language-tools/issues/333) - [Syntax highlighting broken when using map attribute inside enum](https://github.com/prisma/language-tools/issues/339) - [Formatting does not add missing relation automatically ](https://github.com/prisma/language-tools/issues/345) - [Show previewFeatures in generator block as auto-completion suggestion](https://github.com/prisma/language-tools/issues/346) - [@unique only gets suggested once per model block](https://github.com/prisma/language-tools/issues/348) - [Recognize usage of experimentalFeatures and give warning and quick-fix](https://github.com/prisma/language-tools/issues/355) - [Using F2 on relation field leads to broken schema](https://github.com/prisma/language-tools/issues/359) - [Snapshot tests for change-readme script](https://github.com/prisma/language-tools/issues/360) ### [`studio`](https://github.com/prisma/studio) - [Unifying model navigation](https://github.com/prisma/studio/issues/478) - [Removing the tree view](https://github.com/prisma/studio/issues/479) - [Removing the code editor & saved tabs](https://github.com/prisma/studio/issues/480) ### [`prisma-engines`](https://github.com/prisma/prisma-engines) - [Run test suite on postgres 13 beta in CI](https://github.com/prisma/prisma-engines/issues/755) - [CI should build binaries for FreeBSD 12](https://github.com/prisma/prisma-engines/issues/852) - [Improve error for nonexistent table](https://github.com/prisma/prisma-engines/issues/873) - [Log if query engine is running in PgBouncer mode](https://github.com/prisma/prisma-engines/issues/877) - [chore: Get rid of outdated dependencies](https://github.com/prisma/prisma-engines/issues/912)