Prisma

Latest version: v0.15.0

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

Scan your dependencies

Page 23 of 44

2.6.2

Today, we are issuing the `2.6.2` patch release.

Fixes

Prisma Client JS
- [2.6.0 Broke some of my update queries 3497](https://github.com/prisma/prisma/issues/3497)
- [Query validation error updating Date field 3512](https://github.com/prisma/prisma/issues/3512)

2.6.1

Today, we are issuing the `2.6.1` patch release.

Fixes

Prisma Client JS
- [2.6.0 Broke some of my update queries 3497](https://github.com/prisma/prisma/issues/3497)
- [Broken `set` on nested update on 2.6.0 3503](https://github.com/prisma/prisma/issues/3503)

2.6.0

Today we are excited to share the `2.6.0` stable release.

🌟 **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%202.6.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.6.0) about the release.**

Major improvements

More robust introspection by keeping manual changes in the Prisma schema file

In prior releases, any manual changes to your Prisma schema would be overridden when invoking `prisma introspect` (e.g. usage of `map` or `map` as well as the renaming of relation fields).

Keeping these manual changes in the Prisma schema file has been available as a preview feature via the `--experimental-reintrospection` already. After getting tested as a preview feature for a few releases, we are excited to promote this functionality to be the default behavior of `prisma introspect` into this stable release.

Note that you can opt-out of this behavior by using the new `--force` flag: `prisma introspect --force`. This will generate a schema purely based on the introspected database and override any prior manual changes.

📚 **Documentation**: [Prisma Introspect](https://www.prisma.io/docs/reference/tools-and-interfaces/introspection)

Preview features

New: Atomic number operations on `update`

With today's release, we introduce atomic number operations for `update` queries in Prisma Client. It allows you to update the values of certain fields _atomically_.

Feature flag

Atomic number operations needs to be enabled with the feature flag `atomicNumberOperations` like so:

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


Usage

We are introducing five atomic operations for `Int` and `Float` fields :

- `increment: x`: Adds `x` to the current value
- `decrement: x`: Subtracts `x` from the current value
- `multiply: x`: Multiplies the current value by `x`
- `divide: x`: Divides the current value by `x`
- `set: x`: Sets the value to `x` (equivalent to `data: { age: 18 }`)

> **Note**: Only one operation can be done per field at a time.

Here's an example of using the new operations:

ts
const result = await prisma.user.update({
where: {
email: 'helloworld.com',
},
data: {
points: {
set: 99, // this just sets the value, equivalent to `data: { points: 18 }`
},
age: {
increment: 1, // age = age + 1 - Happy Birthday!
},
credits: {
decrement: 2, // credits = credits - 2
},
karma: {
multiply: 3, // karma = karma * 3
},
chocolates: {
divide: 4, // chocolates = chocolates / 4
},
},
})


📚 **Documentation**: [Atomic operations on update](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/crud#atomic-operations-on-update)

Please [share your feedback](https://github.com/prisma/prisma/issues/3491) on how this feature works for you. We are interested in both positive and negative feedback, so we know if this feature is already ready for production! (If encounter any problems, please open a new issue [here](https://github.com/prisma/prisma/issues/new/choose)).

Already existing preview features from previous releases

Just a quick reminder:

- In version [`2.5.0`](https://github.com/prisma/prisma/releases/tag/2.5.0) we introduced one preview feature, namely `insensitiveFilters`.
- In version [`2.1.0`](https://github.com/prisma/prisma/releases/tag/2.1.0) we introduced two preview features, namely `connectOrCreate` and `transactionApi`.

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.

🤔 How would you describe Prisma?

We'd love to hear from you how you describe Prisma to your developer friends and coworkers. If you have 2 minutes, please answer this question via this [online form](https://prisma103696.typeform.com/to/icvIBKPv).

🌟 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.6.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.6.0).

Fixes and improvements

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

- [Rust Panic when querying a model with id](https://github.com/prisma/prisma/issues/1729)
- [Invalid `prisma/.env` leads to confusing error message](https://github.com/prisma/prisma/issues/1739)
- [[EPIC] Re-Introspection](https://github.com/prisma/prisma/issues/2829)
- [`prisma generate` stack overflow on a large schema](https://github.com/prisma/prisma/issues/3051)
- [[Re-Introspection] Comments in the schema are removed by re-introspection](https://github.com/prisma/prisma/issues/3052)
- [Self-referential one-to-many relationship query fails: "subquery has too many columns"](https://github.com/prisma/prisma/issues/3078)
- [Error in update with empty disconnect field](https://github.com/prisma/prisma/issues/3169)
- [Formatting Prisma 2 schema programmatically in JavaScript (file and string)](https://github.com/prisma/prisma/issues/3265)
- [Generating to a custom output path shows the wrong usage instructions](https://github.com/prisma/prisma/issues/3268)
- [Duplicate identifier 'Action' in `node_modules/.prisma/client/index.d.ts`](https://github.com/prisma/prisma/issues/3272)
- [Use error code for invalid schema.prisma for reintrospection and migrate](https://github.com/prisma/prisma/issues/3323)
- [Stabilize Re-Introspection and integrate it into normal `introspect`](https://github.com/prisma/prisma/issues/3331)
- [[Re-Introspection] Keep `updatedAt`](https://github.com/prisma/prisma/issues/3335)
- [List Relation Filter issue just in 2.5.0](https://github.com/prisma/prisma/issues/3342)
- [Filtering by null seems to be broken in 2.5](https://github.com/prisma/prisma/issues/3352)
- [JSON fields filtering stopped working in 2.5.0](https://github.com/prisma/prisma/issues/3364)
- [Add check of git commit during dowload tests ](https://github.com/prisma/prisma/issues/3415)
- [Aggregate ignores map value of field, generating an incorrect query](https://github.com/prisma/prisma/issues/3425)
- [Fix JSON autocompletion](https://github.com/prisma/prisma/issues/3441)
- [undici dependency cannot install - " Couldn't find match for "e76f6a37836537f08c2d9b7d8805d6ff21d1e744" git://github.com/mcollina/undici.git" - prisma/engine-core](https://github.com/prisma/prisma/issues/3472)


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

- [Hide top-level client properties (as they are visible via JS code intellisense)](https://github.com/prisma/prisma-client-js/issues/421)
- [Error when executing findMany query](https://github.com/prisma/prisma-client-js/issues/550)
- [Log event typing breaks when adding datasources to `PrismaClient` constructor](https://github.com/prisma/prisma-client-js/issues/801)
- [node script hanging after disconnect](https://github.com/prisma/prisma-client-js/issues/839)
- [New error after update to 2.5 for "not null" query](https://github.com/prisma/prisma-client-js/issues/842)
- [Implement step 1 of atomic operations on update ](https://github.com/prisma/prisma-client-js/issues/844)


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

- [Multiple failures for error report, error report is just validation error in the end](https://github.com/prisma/migrate/issues/535)
- [Report id 9877: ` Error querying the database: near ",": syntax error`](https://github.com/prisma/migrate/issues/543)
- [Running `save` outputs connection strings if included in schema file](https://github.com/prisma/migrate/issues/551)
- [schema validation errors should not trigger an error reporting](https://github.com/prisma/migrate/issues/571)


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

- [Document and Surface "Rename" functionality better](https://github.com/prisma/language-tools/issues/392)
- [Remove badges from VSCode Marketplace README](https://github.com/prisma/language-tools/issues/393)
- ["No result" when trying to rename model where it is used as type, not in model definition](https://github.com/prisma/language-tools/issues/394)
- [Enum default autocompletion support](https://github.com/prisma/language-tools/issues/404)
- [Detect VSCode theme and tell people to use a different one for better experience](https://github.com/prisma/language-tools/issues/405)
- [map gets initialized with `[]` instead of `""` when using autocompletion](https://github.com/prisma/language-tools/issues/429)
- [Option to stop extension from creating .vscode folder in workspace](https://github.com/prisma/language-tools/issues/439)


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

- [Opening relations in new tabs](https://github.com/prisma/studio/issues/9)
- [Relation "accordion" is closed when I click somewhere outside of the browser window](https://github.com/prisma/studio/issues/434)
- [Relation accordion does not indicate which items are/is connected](https://github.com/prisma/studio/issues/436)
- [Cmd+Click on a relation cell should open a new tab with appropriate filters applied to show only the connected records](https://github.com/prisma/studio/issues/474)
- [Opening the relations view is considered making a change](https://github.com/prisma/studio/issues/488)
- [Briefly displaying "No rows to shows" while loading is a bit confusing](https://github.com/prisma/studio/issues/489)
- [[feature] UX: click-through relations](https://github.com/prisma/studio/issues/499)
- [Info: The preview flags `middlewares` were removed, you can now safely remove them from your schema.prisma.](https://github.com/prisma/studio/issues/502)
- [Relation table is missing a min-height](https://github.com/prisma/studio/issues/506)
- [Error when trying to add a new record](https://github.com/prisma/studio/issues/508)
- [Blank screen when trying to filter a string field](https://github.com/prisma/studio/issues/510)
- [New Tab button (+) should always create a new tab](https://github.com/prisma/studio/issues/512)
- [Clicking a relation in relation table scrolls to the row in addition to selecting it](https://github.com/prisma/studio/issues/513)
- [New record disappears when navigating away (if there are no other records in the table)](https://github.com/prisma/studio/issues/514)
- [Visual feedback when adding new row if scrolled down](https://github.com/prisma/studio/issues/515)
- [Show fatal errors instead of White Screen of Death](https://github.com/prisma/studio/issues/516)
- [Update error message to say `prisma` not `prisma/cli`](https://github.com/prisma/studio/issues/517)
- [Relation table headers overlap if the model name is too long](https://github.com/prisma/studio/issues/518)
- [Some (not all) column type icons overlap the next column](https://github.com/prisma/studio/issues/519)
- [`skip` can be set to negative](https://github.com/prisma/studio/issues/521)
- [It isn't possible to delete uncommitted records](https://github.com/prisma/studio/issues/522)
- [Ugly scrollbar in relation editor](https://github.com/prisma/studio/issues/523)
- [Save [x] changes count not valid after creating a record](https://github.com/prisma/studio/issues/524)
- [Relation editor table should have a min-height](https://github.com/prisma/studio/issues/525)
- [Inconsistent state with no tabs](https://github.com/prisma/studio/issues/526)
- [Render a separator between uncommitted & committed records](https://github.com/prisma/studio/issues/527)


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

- [Datamodel Parser: Native Types](https://github.com/prisma/prisma-engines/issues/71)
- [Log what error caused a rollback in query engine](https://github.com/prisma/prisma-engines/issues/879)
- [Do not generate unnecessary db queries](https://github.com/prisma/prisma-engines/issues/969)
- [Adding optional relations on existing models on SQLite does not add a foreign key constraint](https://github.com/prisma/prisma-engines/issues/1022)
- [Multi-line alter tables on SQLite appear not to be working](https://github.com/prisma/prisma-engines/issues/1023)
- [Check that unique constraints can be added/removed from existing tables on MySQL](https://github.com/prisma/prisma-engines/issues/1027)
- [Check that column arity is preserved by AlterEnum on MySQL](https://github.com/prisma/prisma-engines/issues/1032)
- [Enum names must be validated that they are not using a reserved name](https://github.com/prisma/prisma-engines/issues/1052)


Credits

Huge thanks to peter50216 for helping!

2.5.1

Today, we are issuing the `2.5.1` patch release.

Fixes

Prisma Client JS
- [List Relation Filter issue just in 2.5.0 3342](https://github.com/prisma/prisma/issues/3342)
- [Filtering by null seems to be broken in 2.5 3352](https://github.com/prisma/prisma/issues/3352)
- [New error after update to 2.5 for "not null" query 842](https://github.com/prisma/prisma-client-js/issues/842)

Studio
- Bug fixes

2.5.0

Today we are excited to share the `2.5.0` stable release.

🌟 **Help us spread the word about Prisma by starring the repo ☝️, [tweeting](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20Prisma%20release%202.5.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.5.0) about the release or sharing your experience with Prisma [on Reddit](https://www.reddit.com/r/typescript/comments/icbey2/which_orm_should_i_use/).** 🌟

Major improvements

Middlewares, removing duplicates with `distinct` and aggregations are now stable

After running in _preview_ mode for a number of releases, we are excited to promote the following features into this stable release:

- `middlewares`
- `distinct`
- `aggregateApi`

This means you can omit the respective feature flags in the `generator` block in your Prisma schema:

diff
generator client {
provider = "prisma-client-js"
- previewFeatures = ["middlewares", "distinct", "aggregateApi"]
}


Read on to learn about each feature individually!

Middlewares

Prisma Client's middleware lets you intercept Prisma Client queries to manipulate its _parameters_ and interrogate its _result_. A middleware is a _function_ that's passed to Prisma Client's `$use` method.

Middlewares are convenient for a number of use cases, for example:

- Logging the time taken to perform a type of query
- Manipulating or validating query parameters
- Contacting another service upon specific queries

The following example includes two middlewares:

ts
const prisma = new PrismaClient()

prisma.$use(async (params, next) => {
const result = next(params);
return result;
}

prisma.$use(async (params, next) => {
return next(params);
}


📚 **Documentation**: [Middleware](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/middleware)

Remove duplicates from query results with `distinct`

Prisma Client allows you to filter duplicate rows from the response to a `findMany` query using the `distinct` option:

ts
const distinctCities = await prisma.user.findMany({
select: {
city: true,
country: true,
},
distinct: ["city"],
});


📚 **Documentation**: [Distinct](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/distinct)

Aggregations with `aggregate`

Prisma Client allows you to perform aggregations operations on the **number** fields (such as `Int` and `Float`) of a model - for example, you can get the average age of all users:

ts
const aggregations = await prisma.user.aggregate({
avg: {
age: true,
},
});

console.log("Average age:" + aggregations.avg.age);


Prisma Client supports the following aggregations:

* `avg` (average)
* `sum` (sum)
* `min` (minimum value)
* `max` (maximum value)

📚 **Documentation**: [Aggregations](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/aggregations)

Preview features

New: Case insensitive filters (PostgreSQL only)

In `2.5.0` we introduce case insensitive filters for querying capabilities to Prisma Client. It allows you to query for fields in a case insensitive way.

> **Note**: This feature will not work if you're using database collations that do not know how to convert between upper- and lowercase letters (e.g. the `C` collation).

📚 **Documentation**: [Case sensitivity](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/case-sensitivity) / [Case-sensitive filtering](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/filtering#case-insensitive-filtering)

Feature flag

Insensitive filters querying needs to be enabled with the feature flag `insensitiveFilters` like so:

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


Usage

The new `mode` option you can pass to `findMany` influences the corresponding filter (e.g. `contains` or `startsWith`) but doesn't change the return type of the `findMany` query. `mode` can have two possible values:

- `default`: Uses the default filter configured on the database level. If the collation is configured as case insensitive in the database, the default mode will be case insensitive as well. In that case, there's no need to use the `insensitive` mode.
- `insensitive`: Uses the case insensitive filter (if possible).

ts
const result = await prisma.user.findMany({
where: {
email: {
equals: 'lowercaseUPPERCASE.com',
mode: 'insensitive',
},
},
})


Please [share your feedback](https://github.com/prisma/prisma/issues/3340) on how this feature works for you. We are interested in both positive and negative feedback, so we know if this feature is already ready for production! (If encounter any problems, please open a new issue [here](https://github.com/prisma/prisma/issues/new/choose)).


<!--
Github issue to be published:

Title: Preview feature feedback: `insensitiveFilters`

Body:
Please share your feedback about the preview feature `insensitiveFilters` that was released in [v2.5.0](https://github.com/prisma/prisma/releases/tag/2.5.0) in this issue.

- If you encounter a bug, please [open a bug report](https://github.com/prisma/prisma/issues/new?assignees=&labels=&template=bug_report.md&title=) in this repo.
- If the feature is working well for you, please share this in a comment below or leave a 👍 on this issue.

If you have any questions, don't hesitate to ask them in the [`prisma2`](https://app.slack.com/client/T0MQBS8JG/CKQTGR6T0) channel in the [Prisma Slack](https://slack.prisma.io).
-->

Feature flags for `middlewares`, `distinct` and `aggregationApi` removed

As mentioned above, we were able to promote three features into this stable release. This was thanks to your help and feedback, so please keep trying the preview features if they're useful to you and help us by sharing feedback.

2.4.1

ts
// order by `age` descending and then by `name` ascending
const data = await client.user.findMany({
orderBy: [
{
age: 'desc',
},
{
name: 'asc',
},
],
})

Page 23 of 44

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.