yarn @prisma/client 2.14.0

latest releases: 5.23.0-dev.10, 5.23.0-dev.9, 5.23.0-integration-engines-5-23-0-8-integration-include-field-native-type-data-to-dmmf-f616ccc38c3d791e452ebd52f830a7fad0161650.2...
3 years ago

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.

Don't miss a new client release

NewReleases is sending notifications on new releases.