Prisma 5.7.0stable Released Dec 06, 2023
Impact Score: 5/10

Prisma 5.7.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 5.7.0. Source highlight: 🌟 **Help us spread the word about Prisma by starring the repo or posting on X (formerly Twitter) about the 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.

🔧 Bug Fixes & Patches (1)

  • `prisma debug` command does not show env variables declared in `.env` file
📄 View Raw Release Notes (Original Developer Log)
🌟 **Help us spread the word about Prisma by starring the repo or [posting on X (formerly Twitter)](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@prisma%20release%20v5.7.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.7.0) about the release.** # Highlights ✨ In this release, we improved the SQL queries Prisma Client generates for you with two new [Preview](https://www.prisma.io/docs/about/prisma/releases#preview) features, the [driver adapters](https://www.prisma.io/docs/concepts/components/database-drivers#driver-adapters), and support for the database drivers we currently support. 5.7.0 will be the last release of the year. Stay tuned for the next one in January! ✨ ## Preview support for `JOIN`s for relation queries for PostgreSQL and CockroachDB We’re excited to announce Preview support for `JOIN`s in Prisma Client when querying relations. Support for `JOIN`s has been a [long-standing feature request](https://github.com/prisma/prisma/issues/5184), and this release adds support for PostgreSQL and CockroachDB. The upcoming releases will expand support for other databases Prisma supports. To get started using `JOIN`s, enable the Preview feature in your Prisma schema: ```prisma // schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["relationJoins"] } ``` Run `prisma generate` to regenerate Prisma Client and enable the Preview feature. Prisma Client will use a `JOIN` in your query to fetch relation data for a majority of the cases. **Example queries** <details> <summary><b>1-1 relation queries example</b></summary> **Prisma Client query** ```tsx await prisma.user.findUnique({ where: { id: 1 }, include: { profile: true } }) ``` **SQL** ```sql SELECT "t1"."id", "t1"."name", "User_profile"."__prisma_data__" AS "profile" FROM "public"."User" AS "t1" LEFT JOIN LATERAL ( SELECT COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__" FROM ( SELECT "t4"."__prisma_data__" FROM ( SELECT JSON_BUILD_OBJECT( 'id', "t3"."id", 'bio', "t3"."bio", 'userId', "t3"."userId" ) AS "__prisma_data__" FROM ( SELECT "t2".* FROM "public"."Profile" AS "t2" WHERE "t1"."id" = "t2"."userId" ) AS "t3" ) AS "t4" ) AS "t5" ) AS "User_profile" ON TRUE WHERE "t1"."id" = $1 LIMIT $2 ``` </details> <details> <summary><b>1-m relation queries example</b></summary> **Prisma Client query** ```tsx await prisma.user.findUnique({ where: { id: 1 }, include: { posts: true } }) ``` **SQL** ```sql SELECT "t1"."id", "t1"."name", "User_posts"."__prisma_data__" AS "posts" FROM "public"."User" AS "t1" LEFT JOIN LATERAL ( SELECT COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__" FROM ( SELECT "t4"."__prisma_data__" FROM ( SELECT JSON_BUILD_OBJECT( 'id', "t3"."id", 'title', "t3"."title", 'content', "t3"."content", 'published', "t3"."published", 'authorId', "t3"."authorId" ) AS "__prisma_data__" FROM ( SELECT "t2".* FROM "public"."Post" AS "t2" WHERE "t1"."id" = "t2"."authorId" /* root select */ ) AS "t3" /* inner select */ ) AS "t4" /* middle select */ ) AS "t5" /* outer select */ ) AS "User_posts" ON TRUE WHERE "t1"."id" = $1 LIMIT $2 ``` </details> <details> <summary><b>m-n relation queries example</b></summary> **Prisma Client query** ```tsx await prisma.post.findUnique({ where: { id: 1 }, include: { tags: true } }) ``` **SQL** ```sql SELECT "t1"."id", "t1"."title", "t1"."content", "t1"."published", "t1"."authorId", "Post_tags_m2m"."__prisma_data__" AS "tags" FROM "public"."Post" AS "t1" LEFT JOIN LATERAL ( SELECT COALESCE(JSON_AGG("__prisma_data__"), '[]') AS "__prisma_data__" FROM ( SELECT "Post_tags"."__prisma_data__" FROM "public"."_PostToTag" AS "t2" LEFT JOIN LATERAL ( SELECT JSON_BUILD_OBJECT('id', "t4"."id", 'name', "t4"."name") AS "__prisma_data__", "t4"."id" FROM ( SELECT "t3".* FROM "public"."Tag" AS "t3" WHERE "t2"."B" = "t3"."id" /* root select */ ) AS "t4" ) AS "Post_tags" ON TRUE WHERE "t2"."A" = "t1"."id" ) AS "Post_tags_m2m_1" ) AS "Post_tags_m2m" ON TRUE WHERE "t1"."id" = $1 LIMIT $2 ``` </details> [Share your feedback](https://github.com/prisma/prisma/discussions/22288) and create a [bug report](https://github.com/prisma/prisma/issues/new?assignees=&labels=kind/bug&projects=&template=bug_report.yml) if you encounter any issues. ## Prisma’s `distinct` option now uses SQL queries (Preview) From this release, Prisma Client’s `distinct` option now uses the native SQL `DISTINCT ON` for unordered queries with PostgreSQL and CockroachDB. The upcoming releases will expand support for the other databases that Prisma supports. Prisma Client already supports [querying for distinct records](https://www.prisma.io/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#select-distinct). However, Prisma Client took care of the post-processing for distinct records in memory. To get started, enable the Preview feature in your Prisma schema: ```prisma // schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["nativeDistinct"] } ``` Regenerate your Prisma Client to get started using the Preview feature. Given the following Prisma Client query: ```tsx await prisma.user.findMany({ distinct: ['role'], select: { role: true, }, }) ``` **Before 5.7.0** Previously, Prisma Client handled the post-processing to select distinct records in-memory. Therefore, the following query was generated and executed against your database: ```sql SELECT "public"."User"."id", "public"."User"."role"::text FROM "public"."User" WHERE 1 = 1 OFFSET $1 ``` **After 5.7.0** ```sql SELECT DISTINCT ON ("public"."User"."role") "public"."User"."id", "public"."User"."role"::text FROM "public"."User" WHERE 1 = 1 OFFSET $1 ``` [Share your feedback](https://github.com/prisma/prisma/discussions/22287) and create a [bug report](https://github.com/prisma/prisma/issues/new?assignees=&labels=kind/bug&projects=&template=bug_report.yml) if you encounter any issues. ## Improved support for Netlify using Node.js v20 In this release, we improved Prisma support when deploying to Netlify on Node.js v20. Previously, the Prisma Client could not resolve the location of the Query Engine after deploying to Netlify when using Node.js v20. If you run into this issue, we recommend updating to Prisma v5.7.0. We recommend giving [this comment](https://github.com/prisma/prisma/issues/22244#issuecomment-1842847194) on GitHub a read if you are not yet able to upgrade Prisma, to learn how to get around the error. # Fixes and improvements ## Prisma Client - [Update: `InterpretationError("Unable to convert expression result into a set of selection results", None)` (starting with 5.2.0)](https://github.com/prisma/prisma/issues/21182) - [Error when inserting record with array enum column after `TRUNCATE`ing the table on CockroachDB: `placeholder $1 already has type string, cannot assign Color`](https://github.com/prisma/prisma/issues/21901) - [Netlify deployment with Node 20 break Prisma (`Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x"`)](https://github.com/prisma/prisma/issues/22244) ## Prisma - [Planetscale Driver doesn't work anymore after updating to 5.6.0 ](https://github.com/prisma/prisma/issues/21956) ## Prisma Migrate - [`prisma debug` command does not show env variables declared in `.env` file](https://github.com/prisma/prisma/issues/21968) ## Credits Huge thanks to @anuraaga, @onichandame, @LucianBuzzo, @RobertCraigie, @fqazi, @KhooHaoYit, @alencardc, @Oreilles, @christianledgard, @skyzh, @alula, @AikoRamalho, @petradonka for helping! # Company news ## 💼 We’re hiring! If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you. We're hiring for the following roles: - [Manager: Developer Advocacy](https://boards.greenhouse.io/prisma/jobs/7051313002) - [Software Engineer](https://boards.greenhouse.io/prisma/jobs/7034499002)