Prisma

Latest version: v0.15.0

Safety actively analyzes 685525 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 44

30.00

// ]


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

jsx
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](https://www.prisma.io/docs/concepts/components/prisma-client/group-by).

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:

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


Learn more in [the documentation](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options).

Prisma Migrate fix for PostGIS users

PostgreSQL users who are using the PostGIS extension [can now use Prisma Migrate](https://github.com/prisma/prisma/issues/4745) 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](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes).

Fixes and improvements

[`prisma`](https://github.com/prisma/prisma)

- [Support number is an input for BigInt fields](https://github.com/prisma/prisma/issues/4195)
- [Deploying to Heroku does not generate Prisma Client by default](https://github.com/prisma/prisma/issues/4210)
- [Create fail with multiple connectOrCreate and connect](https://github.com/prisma/prisma/issues/4230)
- [Sequential $transaction with $executeRaw](https://github.com/prisma/prisma/issues/4269)
- [Transaction items run outside Postgres transaction (breaks) with random order](https://github.com/prisma/prisma/issues/4331)
- [Add more jsdoc to Prisma Client](https://github.com/prisma/prisma/issues/4344)
- [Rename findOne in dmmf.schema.outputObjectTypes.prisma Query](https://github.com/prisma/prisma/issues/4358)
- [Errors with setting foreigns keys directly](https://github.com/prisma/prisma/issues/4442)
- [multiple identical compound unique fields with different types not generating multiple types](https://github.com/prisma/prisma/issues/4454)
- [The target table of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.](https://github.com/prisma/prisma/issues/4535)
- [Prisma Migrate: Error creating shadow database](https://github.com/prisma/prisma/issues/4571)
- [Integrate Linux ARM in TypeScript](https://github.com/prisma/prisma/issues/4573)
- [Reintrospection Bug on Relations](https://github.com/prisma/prisma/issues/4582)
- [Prisma Migrate: Omit schema name when creating enum types?](https://github.com/prisma/prisma/issues/4626)
- [Tearing down MSSQL schema returns "Cannot read property 'split' of null"](https://github.com/prisma/prisma/issues/4635)
- [prisma introspect drops some relation custom names in existing schema](https://github.com/prisma/prisma/issues/4664)
- [Implement `react-prisma` prototype](https://github.com/prisma/prisma/issues/4767)
- [unable to run migrations in an empty PostGIS db](https://github.com/prisma/prisma/issues/4745)

[`prisma-client-js`](https://github.com/prisma/prisma-client-js)

- [Group By](https://github.com/prisma/prisma-client-js/issues/1)
- [Generated Github issue creation links do often not include helpful information](https://github.com/prisma/prisma-client-js/issues/865)
- [PANIC: expected 0 parameters but got 1 (when running $executeRaw`...`)](https://github.com/prisma/prisma-client-js/issues/940)


[`migrate`](https://github.com/prisma/migrate)

- [Removing a model with a foreign key fails](https://github.com/prisma/migrate/issues/667)


[`language-tools`](https://github.com/prisma/language-tools)

- [While Prisma extension is enabled, typescript server keeps crashing on each save](https://github.com/prisma/language-tools/issues/604)
- [Transition open-vsx extension to Eclipse Cloud Development Tools working group](https://github.com/prisma/language-tools/issues/621)
- [Renaming models in schema.prisma may break whole file](https://github.com/prisma/language-tools/issues/652)


[`studio`](https://github.com/prisma/studio)

- [Allow filtering by relation fields](https://github.com/prisma/studio/issues/520)


[`prisma-engines`](https://github.com/prisma/prisma-engines)

- [MySQL case sensitivity issue in ME on windows](https://github.com/prisma/prisma-engines/issues/950)
- [Apply `clippy` to `query-engine`](https://github.com/prisma/prisma-engines/issues/1387)


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**](https://prisma103696.typeform.com/to/q2txzFif) that represents a potential _onboarding flow_ for that cloud offering.

20.00

16.13.0

The minimum version of Node.js Prisma supports is `16.13.0`. If you're using an earlier version of Node.js, you will need to upgrade your Node.js version.

Refer to our [system requirements](https://www.prisma.io/docs/reference/system-requirements) for the minimum versions Prisma requires.

10.00

9.6

The minimum version of PostgreSQL Prisma supports is version 9.6. If you’re either using 9.4 or 9.5, you will need to update your PostgreSQL version to at least 9.6.

Refer to our [system requirements](https://www.prisma.io/docs/reference/database-reference/supported-databases) for the minimum database versions Prisma requires.

Prisma Client embedded SQLite version upgrade

We upgraded the embedded version of SQLite from 3.35.4 to 3.41.2. We do not anticipate any breaking changes or changes needed in projects using SQLite. However, if you’re using SQLite, especially with raw queries that might go beyond Prisma's functionality, make sure to check [the SQLite changelog](https://www.sqlite.org/changes.html).

Removal of `rejectOnNotFound` property

In version 5.0.0, we removed the `rejectOnNotFound` parameter from Prisma Client that was deprecated in version 4.0.0. We removed this feature to provide better type-safety using the `findUniqueOrThrow` and `findFirstOrThrow` methods as well have a consistent API.

If you are using the `rejectOnNotFound` parameter we recommend either:

- Replacing your queries with the `findFirstOrThrow` or `findUniqueOrThrow` methods if enabled at a *query-level*
- Using a [Prisma Client extension](https://www.prisma.io/docs/concepts/components/prisma-client/client-extensions) to overload the `findFirstOrThrow` and `findUniqueOrThrow` model methods with your custom error handling if enabled at the *client-level*

We recommend taking a look at the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5#removal-of-array-shortcutsremoval-of-rejectonnotfound-parameter) for more information on how to adapt your application if you’re using `rejectOnNotFound`.

`cockroachdb` provider is now required when connecting to a CockroachDB database

Prior to adding explicit support for CockroachDB with the `cockroachdb` provider in [3.9.0](https://github.com/prisma/prisma/releases/tag/3.9.0), it was possible to use the PostgreSQL provider when working with CockroachDB databases.

We’re now making it mandatory to use the CockroachDB connector when working with CockroachDB databases. CockroachDB and PostgreSQL have a few differences such as the available native types which impact the generated migrations.

If you were using the PostgreSQL connector to work with CockroachDB, take a look at the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5#cockroachdb-provider-is-now-required-when-connecting-to-a-cockroachdb-database) to learn how you can update your connector.

Removal of the generated `runtime/index.js` file from Prisma Client

With Prisma 5, we removed the `runtime/index.js` file from Prisma Client. If you were using APIs from `runtime/index.js`, such as `Decimal` , `PrismaClientKnownRequestError`,  `NotFoundError`,  `PrismaClientUnknownRequestError`, we recommend updating your imports:

diff
- import { Decimal } from 'prisma/client/runtime'
+ import { Prisma } from 'prisma/client'

// Usage update of Prisma Client's utilities
- Decimal
+ Prisma.Decimal


We recommend taking a look at the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5#removal-of-array-shortcutsremoval-of-runtimeindexjs-from-generated-client) to learn how you can migrate to Prisma 5

Removal of the `beforeExit` hook from the `library` query engine

We removed the `beforeExit` hook from the default `library` Query Engine. We recommend using the built-in Node.js exit events.

diff
-prisma.$on('beforeExit', () => { /* your code */ })

// Replacements
process.on('beforeExit', () => { /* your code */ })
process.on('exit', exitHandler)
process.on('SIGINT', exitHandler)
process.on('SIGTERM', exitHandler)
process.on('SIGUSR2', exitHandler)


We recommend taking a look at the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5#removal-of-the-beforeexit-hook-from-the-library-engine) to learn how you can migrate to Prisma 5.

Removal of deprecated `prisma2` executable

When we released Prisma 2, the `prisma2` executable was used to differentiate it from Prisma 1. In a later release, the `prisma2` CLI took over the `prisma` executable name.

The `prisma2` executable has been deprecated for a while and will now be removed. If you’re using `prisma2` in your scripts, replace it with `prisma`.

Removal of deprecated flags in the Prisma CLI

We removed the following deprecated flags in the Prisma CLI:

- **`--preview-feature`**: used in the `prisma db execute`, `prisma db seed`, and `prisma migrate diff` commands
- **`--experimental`** and **`--early-access-feature`**: used in the `prisma migrate` commands such as `prisma migrate dev`
- **`--force`**: for `prisma db push`. The `--force` flag was replaced by `--accept-data-loss` in version 2.17.0
- **`--experimental-reintrospection`** and **`--clean`**: for `prisma db pull`

In the event you’re using one of these flags, we recommend removing the flags.

Removal of deprecated `experimentalFeatures` generator property

In this release, we removed the `experimentalFeatures` property that used to be in the generator property in the Prisma schema but has been renamed to `previewFeatures` for a long time now. If you’re still using this property, you can either manually rename it to `previewFeatures` or use the VS Code action to rename it if you’re using the latest version of the Prisma VS Code extension.

Renamed `migration-engine` to `schema-engine`

In this release, we renamed the `migration-engine`, responsible for running introspection and migration commands, to `schema-engine` . For the majority of our users, no changes will be required. However, if you explicitly include or exclude the engine files you will need to update your code references. Refer to the [upgrade guide](https://www.prisma.io/docs/guides/upgrade-guides/upgrading-versions/upgrading-to-prisma-5#migration-engine-renamed-to-schema-engine) for more information.


Fixes and improvements

Prisma Client

- [Getting a string '(array)' in the generator config instead of the expected value when array is used](https://github.com/prisma/prisma/issues/9511)
- [Misleading error message from `create` call](https://github.com/prisma/prisma/issues/11425)
- [Client extensions incorrect typings when defined both specific model and all models methods](https://github.com/prisma/prisma/issues/17458)
- [UncheckedUpdateManyInput types lead to conflicting names](https://github.com/prisma/prisma/issues/18534)
- [`<Model>RelationFilterInput` does not take nullability into account](https://github.com/prisma/prisma/issues/18585)
- [Full text search query with `OR` broke after opting in to `jsonProtocol` feature.](https://github.com/prisma/prisma/issues/18885)
- [Prisma Client: remove list shorthands (for `jsonProtocol`)](https://github.com/prisma/prisma/issues/19303)
- [Remove outdated preview feature aliases (transactionApi, aggregateApi)](https://github.com/prisma/prisma/issues/19305)
- [Prisma Client generator: remove creation of a package.json](https://github.com/prisma/prisma/issues/19306)
- [Prisma Client: make `jsonProtocol` GA ](https://github.com/prisma/prisma/issues/19310)
- [Only upload engines files to `binaries.prisma.sh/all_commits/`](https://github.com/prisma/prisma/issues/19311)
- [Prisma Client: remove "beforeExit" hook from LibraryEngine/DataProxyEngine](https://github.com/prisma/prisma/issues/19312)
- [Prisma Client: remove `rejectOnNotFound`](https://github.com/prisma/prisma/issues/19315)
- [Prisma Client: remove `runtime/index.js` bundle from client](https://github.com/prisma/prisma/issues/19316)
- [Prisma CLI: remove non-existing `prisma dev` command](https://github.com/prisma/prisma/issues/19318)
- [Prisma Client: remove legacy `photonResolver` and `provider=photonjs` handling](https://github.com/prisma/prisma/issues/19319)
- [Prisma Client: make `fieldReference` GA](https://github.com/prisma/prisma/issues/19379)
- [Prisma Client: make `extendedWhereUnique` GA](https://github.com/prisma/prisma/issues/19380)
- [Remove backward compatibility for Prisma Client < 2.20 and Prisma CLI >= 2.20](https://github.com/prisma/prisma/issues/19417)
- [Prisma CLI: remove `prisma2` "executable"](https://github.com/prisma/prisma/issues/19438)
- [Query in findMany in prisma extends returns a wrong type](https://github.com/prisma/prisma/issues/19854)
- [Can't specify $queryRawUnsafe return type after extending prisma client](https://github.com/prisma/prisma/issues/19862)
- [FindMany returns wrong type after extending prisma client](https://github.com/prisma/prisma/issues/19864)
- [4.16.x cannot wrap `$extend` in factory function when `compilerOptions.composite` is `true`](https://github.com/prisma/prisma/issues/19866)
- [4.16: (MongoDB) Generated types for list composites are incorrect](https://github.com/prisma/prisma/issues/19880)
- [Prisma Client Extensions: $allModels: { $allOperations } sets `query` type to `never`](https://github.com/prisma/prisma/issues/19888)
- [Prisma Schema Type inside a Type not generating a right Payload](https://github.com/prisma/prisma/issues/19890)
- [Field references are not available on extended clients](https://github.com/prisma/prisma/issues/19892)
- [Prisma Client fluent API does not work with extends anymore on 4.16.1](https://github.com/prisma/prisma/issues/19921)
- [Prisma not generating correct payload for types in models for MongoDB for 4.16.1 ](https://github.com/prisma/prisma/issues/19933)
- [Prisma requires to install bun when generating client library ](https://github.com/prisma/prisma/issues/19945)
- [Getting wrong types with prisma client extensions](https://github.com/prisma/prisma/issues/19958)
- [Prisma Client: updating to 4.16.0 or 4.16.1 breaks Cloudflare worker, it errors with `The package "path" wasn't found on the file system but is built into node`](https://github.com/prisma/prisma/issues/19972)
- [Result types are incorrectly inferred when `undefined` explicitly passed to `select`/`include`](https://github.com/prisma/prisma/issues/19997)
- [Migrating to release: 4.16.2 throws typescript error: "TS1005: '?' expected".](https://github.com/prisma/prisma/issues/20024)

Prisma Migrate

- [Make connecting to a cockroachdb database with `provider = "postgresql"` an error](https://github.com/prisma/prisma/issues/13222)
- [Remove the deprecated `experimentalFeatures` generator property](https://github.com/prisma/prisma/issues/16294)
- [Remove support for PostgreSQL 9.4 and 9.5](https://github.com/prisma/prisma/issues/19300)
- [Upgrade embedded SQLite version](https://github.com/prisma/prisma/issues/19301)
- [Drop support for Node.js v14](https://github.com/prisma/prisma/issues/19304)
- [`db pull`: Remove the version checker from introspection](https://github.com/prisma/prisma/issues/19314)
- [Prisma CLI: remove undocumented `doctor` command](https://github.com/prisma/prisma/issues/19317)
- [Rename migration-engine to schema-engine](https://github.com/prisma/prisma/issues/19321)
- [Prisma CLI: remove deprecated flags, arguments and "old migrate" logic](https://github.com/prisma/prisma/issues/19448)
- [Remove obsolete `experimentalFeatures` generator property](https://github.com/prisma/prisma/issues/19540)
- [Remove usage / mention of `experimentalFeatures`](https://github.com/prisma/prisma/issues/19541)

Language tools (e.g. VS Code)

- [Mark `experimentalFeatures` as obsolete](https://github.com/prisma/language-tools/issues/1435)


Credits

Huge thanks to michaelpoellath, RobertCraigie, Coder246, RDIL, oohwooh, rqres, zhiyan114, spudly, hayes, boennemann, DongGunYoon for helping!

📺 Join us for another "What's new in Prisma" live stream

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://youtube.com/playlist?list=PLn2e1F9Rfr6l1B9RP0A9NdX7i7QIWfBa7) live stream.

The stream takes place [on YouTube](https://youtu.be/6rlKp_eBdZA) on **Thursday, July 13** at **5 pm Berlin | 8 am San Francisco**.

5.18.0

🌟 **Help us spread the word about Prisma by starring the repo or [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20prisma%20release%20v5.18.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.18.0) about the release.** 🌟

Highlights

Native support for UUIDv7

Previous to this release, the Prisma Schema function `uuid()` did not accept any arguments and created a UUIDv4 ID. While sufficient in many cases, UUIDv4 has a few drawbacks, namely that it is not temporally sortable.

UUIDv7 attempts to resolve this issue, making it easy to temporally sort your database rows by ID!

To support this, we’ve updated the `uuid()` function in Prisma Schema to accept an optional, integer argument. Right now, the only valid values are `4` and `7`, with `4` being the default.

tsx
model User {
id String id default(uuid()) // defaults to 4
name String
}

model User {
id String id default(uuid(4)) // same as above, but explicit
name String
}

model User {
id String id default(uuid(7)) // will use UUIDv7 instead of UUIDv4
name String
}


Bug squashing

We’ve squashed a number of bugs this release, special thanks to everyone who helped us! A few select highlights are:

- [SQLite db will now be created and read from the correct location when using `prismaSchemaFolder`](https://github.com/prisma/prisma/issues/24779).
- [Empty `Json[]` fields will now return `[]` instead of `null` when accessed through a join using the `relationJoins` Preview feature.](https://github.com/prisma/prisma/issues/22923)

Fixes and improvements

Prisma

- [Support UUID v7](https://github.com/prisma/prisma/issues/24079)

Language tools (e.g. VS Code)

- [Support fetching references for a model](https://github.com/prisma/language-tools/issues/982)

Share your feedback about Prisma ORM

We want to know how you like working with Prisma ORM in your projects! Please [take our 2min survey](https://pris.ly/orm-survey-5-18) and let us know what you like or where we can improve 🙏

Credits

Huge thanks to mcuelenaere, pagewang0, Druue, key-moon, Jolg42, pranayat, ospfranco, yubrot, skyzh, haaawk for helping!

Page 1 of 44

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.