Prisma: 2.14.0 Release

Release date:
January 4, 2021
Previous version:
2.13.1 (released December 17, 2020)
Magnitude:
2,921 Diff Delta
Contributors:
4 total committers
Data confidence:
Commits:

34 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored December 28, 2020
Authored December 28, 2020
Authored December 21, 2020
Authored December 22, 2020
Authored December 30, 2020
Authored January 4, 2021
Authored December 29, 2020
Authored December 28, 2020
Authored December 21, 2020
Authored December 29, 2020
Authored December 21, 2020
Authored December 29, 2020
Authored January 4, 2021
Authored December 29, 2020
Authored January 4, 2021
Authored December 18, 2020
Authored January 4, 2021
Authored January 4, 2021
Authored January 4, 2021
Authored December 30, 2020
Authored December 28, 2020
Authored December 21, 2020

Top Contributors in 2.14.0

timsuchanek
Jolg42
williamluke4
renovate-bot

Directory Browser for 2.14.0

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

We hope everyone enjoyed their holidays and recharged for 2021! Today, we are excited to share the 2.14.0 stable release 🎉

🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release.

Major improvements

Group By queries are now in Preview

Prisma Client now supports group by queries! Opt-in to this feature by adding the groupBy flag to the generator block in your Prisma schema:

 generator client {
   provider        = "prisma-client-js"
+  previewFeatures = ["groupBy"]
 }

 model Agent {
   id         String @id
   name       String
   location   String
   rate       Float
 }

Now you can re-generate your Prisma Client to have access to the new groupBy API:

npx prisma generate

With the updated Prisma Client, you can invoke the new groupBy query:

const locations = await client.agent.groupBy({
  by: ['location'],
  min: {
    rate: true
  },
})

// Result:
// [
//   { location: "Los Angeles", min: { rate: 10.00 } },
//   { location: "London", min: { rate: 20.00 } },
//   { location: "Tokyo", min: { rate: 30.00 } }
// ]

Prisma also supports the having side of group by, so you can further filter your groups:

const locations = await client.agent.groupBy({
  by: ['location', 'rate'],
  min: {
    rate: true
  },
  having: {
    rate: {
      gte: 20
    }
  }
})

// Result:
// [
//   { location: "London", rate: 20.00, min: { rate: 20.00 } },
//   { location: "Tokyo", rate: 30.00, min: { rate: 30.00 } }
// ]

Read more in the documentation.

Linux ARM64 support

Good news for Linux users! Prisma now supports Linux ARM64 out of the box. If you already generate the Prisma Client on a Linux ARM box, it will just work. To target the specific binary, you can add a binaryTarget to the generator block in your Prisma schema:

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["linux-arm-openssl-1.1.x"]
}

Learn more in the documentation.

Prisma Migrate fix for PostGIS users

PostgreSQL users who are using the PostGIS extension can now use Prisma Migrate as well.

Breaking changes

This release introduces a breaking change for TypeScript users. Prisma Client now requires TypeScript v4.1 or above. You can read more about upgrading your TypeScript version on their wiki.

Fixes and improvements

prisma

prisma-client-js

migrate

language-tools

studio

prisma-engines

Credits

Huge thanks to @qsona for helping!

Help shape the future of Prisma

We love open-source and are commited to building world-class database tools that make developers more productive. In addition to building open-source tools, we are currently planning a cloud offering that will improve many database workflows, especially in collaborative environments.

If you want to help us shape the future of this offering, we would much appreciate if you could fill out this short survey that represents a potential onboarding flow for that cloud offering.