Prisma

Latest version: v0.15.0

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

Scan your dependencies

Page 18 of 44

2.24.1

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

Fixes

Prisma Client
- [In 2.24.0 createMany errors with: PANIC in query-engine/connectors/sql-query-connector/src/database/operations/write.rs:95:60called Result::unwrap() on an Err value: ScalarFieldNotFound { name: "updated_at", model: "FundMangerTeamMemberExperience" } 7416](https://github.com/prisma/prisma/issues/7416)
- [Performance regression with napi for high concurrency 7404](https://github.com/prisma/prisma/issues/7404)
- [Failed to run future: no available capacity / QueueFull 6683](https://github.com/prisma/prisma/issues/6683)

2.24.0

Today, we are excited to share the `2.24.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%20v2.24.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.24.0) about the release.** 🌟 

Major improvements & new features

MongoDB gets `Json` and `Enum` Support

We just added `Json` and `enum` support to the MongoDB `provider` for Prisma Client. Here's an example with both:

prisma
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

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

model Log {
id String id default(dbgenerated()) map("_id") db.ObjectId
message String
level Level default(Info)
meta Json
}

enum Level {
Info
Warn
Error
}


You can then use the generated client like this:

jsx
await prisma.log.create({
data: {
level: "info",
message: "User signed in",
meta: { user_id: 1 },
},
})


As a reminder, the `mongodb` provider is still in [Early Access](https://www.prisma.io/docs/about/releases#early-access). If you'd like to use MongoDB with Prisma, please fill out this [2-minute Typeform](https://prisma103696.typeform.com/to/FriDuIeM) and we'll get you an invite to our Getting Started Guide and private Slack channel right away!

New features for the Prisma Data Platform

The [Prisma Data Platform](https://cloud.prisma.io) (PDP) helps developers collaborate better in projects that are using the open-source tools. One of its main features today is an [online data browser](https://www.prisma.io/blog/prisma-online-data-browser-ejgg5c8p3u4x).

View schema

You can now view your project's schema in order to better understand your application or collaborate with your colleagues. The only roles that can view it are: _Admin_ and _Developer_

<details><summary>Expand for a screenshot of the new schema view</summary>
<img src="https://user-images.githubusercontent.com/329419/120306754-da88f580-c2da-11eb-89dc-f8dc2bfade8c.png" alt="View your Schema" width="450" />
</details>

Delete & edit your project

You can now delete your project from your settings.

<details><summary>Expand for a screenshot of the new settings</summary>
<img src="https://user-images.githubusercontent.com/329419/120306724-cfce6080-c2da-11eb-8af2-d1cb7c21635a.png" alt="Delete your Project" width="450" />
</details>

You can also edit your Project's URL, so you can now correct any mistakes you might have made while creating your project.

Static IPs are now supported

If your database is behind a proxy and you need a static IP to allowlist in order to give access to it, you can now get in touch with us by [creating an issue](https://github.com/prisma/studio/issues/new?assignees=&labels=topic%3A+hosted+data+browser&template=hosted-data-browser-bug-report.md&title=) or sending an email at [`martzoukosprisma.io`](mailto:martzoukosprisma.io) and we'll enable it for you.

Please note that while this feature is freely available now, it will be offered as part of a paid plan in the future (towards the end of '21 or beginning of '22).

Fixes and improvements

Prisma Client

- [Prisma CLI installation hangs indefinitely inside of docker (Kernel 5.10)](https://github.com/prisma/prisma/issues/5304)
- [SQL Server crashes when using autoincrement with createMany](https://github.com/prisma/prisma/issues/6711)
- [PANIC in query-engine\core\src\interpreter\query_interpreters\nested_read.rs:79:561](https://github.com/prisma/prisma/issues/7007)
- [[MongoDB] Smooth out the workflow for updating your schema](https://github.com/prisma/prisma/issues/7030)
- [Schema generation freezed after bitbucket OS upgrade (FlatCarOS upgrade 2605.12.0 to 2765.2.2 (kernel move from 5.4.92 directly to 5.10.25))](https://github.com/prisma/prisma/issues/7037)
- [PANIC in query-engine\core\src\query_graph_builder\read\utils.rs:52:85called `Result::unwrap()` on an `Err` value: FieldNotFound { name: "_count", model: "Post" }](https://github.com/prisma/prisma/issues/7091)
- [N-API feature creates memory leak](https://github.com/prisma/prisma/issues/7092)
- [MongoDB: Many to many relation issue](https://github.com/prisma/prisma/issues/7119)
- [Disallow passing a string as a path in Postgres](https://github.com/prisma/prisma/issues/7136)


Prisma Migrate

- ["Getting is_identity from Resultrow...." crash on Postgres](https://github.com/prisma/prisma/issues/6983)
- [Disable "db" and "migrate" commands for "mongodb" provider until we support it.](https://github.com/prisma/prisma/issues/7012)
- [Support PlanetScale in Migrate](https://github.com/prisma/prisma/issues/7294)


Prisma Studio

- [Not working in VSCode (docker) devcontainer](https://github.com/prisma/studio/issues/687)
- [Running prisma studio behind a nginx https reverse proxy doesn't work](https://github.com/prisma/studio/issues/688)


Prisma Engines

- [Add Parameter to the NAPI Constructor to enable LOG_QUERIES](https://github.com/prisma/prisma-engines/issues/1877)
- [Parse type names in datamodel parser at the pest level instead of regular expressions](https://github.com/prisma/prisma-engines/issues/1917)
- [[N-API] Export Functional Engine Commands along side QueryEngine Constructor](https://github.com/prisma/prisma-engines/issues/1926)
- [Make migration ordering stable](https://github.com/prisma/prisma-engines/issues/1942)


Credits

Huge thanks to Sytten for helping!

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

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=nTI4jjsyoEg&ab_channel=Prisma) livestream.

The stream takes place [on Youtube](https://www.youtube.com/watch?v=nTI4jjsyoEg&ab_channel=Prisma) on **Thursday, June 3rd** at **5pm Berlin | 8am San Francisco**.


🌎 Prisma Day is coming

Save the date for [Prisma Day 2021](https://www.prisma.io/day) and join us for two days of talks and workshops by the most exciting members of the Prisma community.

- June 29th: Workshops
- June 30th: Talks

We look forward to seeing you there!

2.23.0

Today, we are excited to share the `2.23.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%`0v2.23.0`%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.23.0) about the release.** 🌟

Major improvements & new features

JSON Filtering is now in Preview

Starting today, you can now filter rows by data inside a `Json` type. JSON filtering support is available in PostgreSQL and MySQL. You can try it today by adding the `filterJson` preview flag to your `generator` block. This has been one of our most popular feature requests, so we're very excited to be getting it into your hands!

To get an idea of how JSON filtering works, let's see how you might query application logs stored in your database. Given the following Prisma schema:

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

model Log {
id Int id default(autoincrement())
level Level
message String
meta Json
}

enum Level {
INFO
WARN
ERROR
}


And the following records in your PostgreSQL database:

| id | level | message | meta |
| --- | ----- | ---------------------------------- | ------------------------------------------------------------ |
| 2 | `INFO` | application listening on port 3000 | `{"host": "bob"}` |
| 3 | `INFO` | upgrading account | `{"host": "alice", "request_id": 10}` |
| 4 | `INFO` | charging customer | `{"host": "alice", "amount": 20, "request_id": 10}` |
| 5 | `ERROR` | credit card expired | `{"host": "alice", "amount": 20, "request_id": 10}` |
| 6 | `INFO` | signing up | `{"host": "bob", "request_id": 1}` |
| 7 | `INFO` | application listening on port 3000 | `{"host": "alice"}` |
| 8 | `INFO` | signed up | `{"host": "bob", "email": "jamesgmail.com", "request_id": 1}` |


We can now filter logs by the data inside the `meta` field. Let's query by the `request_id` inside the `meta` field to track the journey that led up to the error.

We can write the following query:

js
const logs = await prisma.log.findMany({
where: {
meta: {
// path looks for the request_id key inside meta
path: ["request_id"],
// and we select rows whose request_id is 10
equals: 10,
},
},
orderBy: {
id: "asc",
},
});


Giving us the entire journey of this person's request:

js
[
{
id: 3,
level: 'INFO',
message: 'upgrading account',
meta: { host: 'alice', request_id: 10 }
},
{
id: 4,
level: 'INFO',
message: 'charging customer',
meta: { host: 'alice', amount: 20, request_id: 10 }
},
{
id: 5,
level: 'ERROR',
message: 'credit card expired',
meta: { host: 'alice', amount: 20, request_id: 10 }
}
]


Please note that the `path` syntax varies depending on the database. We pass the `path` query directly to the database, so there will be syntactical differences.

For example, querying by key in Postgres is `request_id`, while in MySQL it would be `$.request_id`. Please consult your database's documentation to learn more.

If you run into any questions or have any feedback, we're available in [this issue](https://github.com/prisma/prisma/issues/7135).

📚 **Documentation**: [Working with Json fields](https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields)

Improvement for `prisma db seed`

In previous versions, a _seed file_ could only be executed as a _script_. `prisma db seed` was simply executing the script by either calling `node ./prisma/seed.js` for JavaScript or `ts-node ./prisma/seed.ts` for TypeScript.

Now, you can directly export a function that Prisma executes on your behalf. Here's the rules that describe the new behavior: Prisma checks if the seed file has ...

- ... an exported function named `seed` and executes it
- ... an exported function (via a _default_ export) and executes it

If there's no function exported as `seed` or via a _default_ export, the behaviour of `prisma db seed` is exactly the same as before, meaning it will simply be executed as a script file.

Breaking changes

Options in `groupBy` queries are now prefixed with an underscore

The options in `groupBy` are now prefixed with an underscore, for example:

diff
// API
const result = await prisma.user.groupBy({
by: ['name'],
- count: true,
+ _count: true,
})


Here's an overview of the exact changes of each option:

| Before `2.23.0` | `2.23.0` and later |
| --------------- | ------------------ |
| `count` | `_count` |
| `max` | `_max` |
| `min` | `_min` |
| `avg` | `_avg` |
| `sum` | `_sum` |

Note that this also changes the names of the fields in the objects that are returned by Prisma Client. For example, in the above case you now access the returned _count_ value like so:

diff
- console.log(result.count)
+ console.log(result._count)


We made this change to avoid clashes with user-defined fields. You can learn more about the problem in [these issues](https://github.com/prisma/prisma/search?q=count&type=issues).

We're sorry for the inconvenience! If you have any questions or need any help, please reach out [in this discussion](https://github.com/prisma/prisma/discussions/7110).

Deprecations

Deprecating options in `aggregate` queries

With the changes to `groupBy` discussed above and recent features like [orderBy an aggregate](https://www.prisma.io/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#order-by-aggregate-group-preview), we took this opportunity to unify `min`, `max`, `avg`, `sum` and `count` keywords across Prisma Client queries.

diff
const result = await prisma.user.aggregate({
- avg: {
+ _avg: {
age: true,
},
})

- result.avg
+ result._avg


Similar to `groupBy`, this is the case for all of our aggregations:

| Before `2.23.0` | `2.23.0` and later |
| --------------- | ------------------ |
| `count` | `_count` |
| `max` | `_max` |
| `min` | `_min` |
| `avg` | `_avg` |
| `sum` | `_sum` |

**This is not a breaking change.** The aggregate queries you wrote prior to `2.23.0` will continue to work as expected. We ask that you make adjustments when you can to future-proof your application.

If you have any questions or need any help, please reach out [in this discussion](https://github.com/prisma/prisma/discussions/7110).

Fixes and improvements

Prisma Migrate

- [Changing foreign key column from optional to required causes migration error](https://github.com/prisma/prisma/issues/4602)
- [Failed Migration Log file output moved to ~/prisma folder](https://github.com/prisma/prisma/issues/4715)
- [prisma db push creates new prisma client inside of ./node_modules/prisma/client](https://github.com/prisma/prisma/issues/4885)
- [Do not force seed to be script](https://github.com/prisma/prisma/issues/5624)
- [Prisma migrate dev prompts for migration name when running after --create-only (2.19)](https://github.com/prisma/prisma/issues/6210)
- ["Name of migration" input unclear when migrations exist](https://github.com/prisma/prisma/issues/6582)
- [Error: Error in migration engine. Reason: [C:\Users\runneradmin\.cargo\git\checkouts\quaint-9f01e008b9a89c14\8196f13\src\connector\result_set\result_row.rs:59:64] index out of bounds: the len is 1 but the index is 10 ](https://github.com/prisma/prisma/issues/6736)
- [Error: [libs/sql-schema-describer/src/sqlite.rs:452:76] get name ](https://github.com/prisma/prisma/issues/6740)
- [Prisma migrate repeatedly generates default value for `dbgenerated("gen_random_uuid()::TEXT")`](https://github.com/prisma/prisma/issues/6794)
- [Error: [libs/datamodel/core/src/transform/ast_to_dml/lift.rs:387:73] called `Option::unwrap()` on a `None` value ](https://github.com/prisma/prisma/issues/6860)
- [Error: [libs/datamodel/connectors/dml/src/model.rs:161:64] Could not find relation field nodes on model nodes. ](https://github.com/prisma/prisma/issues/6861)
- [Indexing error when run migration again](https://github.com/prisma/prisma/issues/6873)
- [Improve diagnostics for timeouts in Migrate](https://github.com/prisma/prisma/issues/6920)
- [Prisma Migrate with SQL Server errors with `Error: Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls` in 2.22.0](https://github.com/prisma/prisma/issues/6984)


Prisma Client

- [Prisma Client hangs and eventually panics when there is no MongoDB server to connect to](https://github.com/prisma/prisma/issues/6431)
- [Where filter not working with JSON.not with another condition](https://github.com/prisma/prisma/issues/6755)
- [Ordering By Relation count incorrectly orders 0 count](https://github.com/prisma/prisma/issues/6824)
- [Incorrect AggregateOutputType DMMF definition of array fields](https://github.com/prisma/prisma/issues/6835)
- [[Feature Request] Ability to use RETURNING in SQLite - Bump SQLite Version up to 3.35.0](https://github.com/prisma/prisma/issues/6876)
- [PANIC in query-engine/core/src/query_graph_builder/read/aggregations/mod.rs:24:18Expected at least oe selection for aggregate](https://github.com/prisma/prisma/issues/7052)


Prisma Studio

- [Prisma studio showed no data](https://github.com/prisma/studio/issues/617)
- [Fatal Error](https://github.com/prisma/studio/issues/636)
- [Prisma Studio not showing data from database upon launch](https://github.com/prisma/studio/issues/649)
- [Prisma Studio not working with Safari 14.0.3](https://github.com/prisma/studio/issues/664)
- [npx prisma studio fails to start up on the browser ](https://github.com/prisma/studio/issues/666)
- [Refreshing prisma studio is stuck on loading screen](https://github.com/prisma/studio/issues/675)
- [Prisma studio not showing the data from the db](https://github.com/prisma/studio/issues/681)


Prisma Engines

- [Testdb setup ignores Migrate errors](https://github.com/prisma/prisma-engines/issues/1834)
- [Found bug in migration checksum](https://github.com/prisma/prisma-engines/issues/1887)


Credits

Huge thanks to Sytten, schiller-manuel, mongolyy, paularah, Iamshankhadeep, meeq for helping!

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

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=lwl0IOj2PxM) livestream.

The stream takes place [on Youtube](https://www.youtube.com/watch?v=lwl0IOj2PxM) on **Thursday, May 20** at **5pm Berlin | 8am San Francisco**.

🌎 Prisma Day is coming

Save the date for [Prisma Day 2021](https://www.prisma.io/day) and join us for two days of talks and workshops by the most exciting members of the Prisma community.

- June 29th: Workshops
- June 30th: Talks ([Submit a talk proposal](https://prisma103696.typeform.com/to/Vlfg1HE2))

We look forward to seeing you there!

2.22.1

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

Fix

Prisma CLI
- [Prisma Migrate with SQL Server errors with Error: Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls in 2.22.0 #6984](https://github.com/prisma/prisma/issues/6984)

2.22.0

Today, we are excited to share the `2.22.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%20v2.22.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/2.22.0) about the release.** 🌟 

Major improvements & new features

`prisma db push` is now Generally Available

`prisma db push` enables you to update the database schema from the Prisma schema file, without generating any migrations.

This is especially useful when prototyping a new feature, iterating on the schema changes before creating migrations or generally if you are at stage of your development process, where you don't need to persist the schema change history via database migrations.

It is now promoted from [Preview](https://www.prisma.io/docs/about/releases#preview) to [General Availabilty](https://www.prisma.io/docs/about/releases#generally-available-ga).

You can find more info on `prisma db push` in the official [docs](https://www.prisma.io/docs/concepts/components/prisma-migrate/db-push).

Deprecation of array notation for `provider` fields

In this release, we are also entirely removing the array notation for the `provider` fields on `datasource` blocks. This has been deprecated since [2.11.0](https://github.com/prisma/prisma/releases/tag/2.11.0) (November 2020).

You can read more about our reasons for this deprecation [here](https://github.com/prisma/prisma/issues/3834).

Prisma Client Go gets support for `AND` operator

We've always had `OR`, but this release we also added `AND` support:

groovy
first, err := client.User.FindFirst(
User.Or(
User.Email.Equals("johnexample.com"),
User.And(
User.Name.Equals("John"),
User.Username.Equals("johno"),
),
),
).Exec(ctx)


Learn more in our [docs](https://github.com/prisma/prisma-client-go/tree/master/docs).


Fixes and improvements

Prisma Migrate

- [[Introspection] Catch ripple effects of guardrails](https://github.com/prisma/prisma/issues/1912)
- [Treat missing `provider` as known error that does not trigger Error Reporting](https://github.com/prisma/prisma/issues/2093)
- [List of integers in SQLite introspected as a list even though SQLite doesn't natively support lists](https://github.com/prisma/prisma/issues/3238)
- [Formatting adds optional relation incorrectly](https://github.com/prisma/prisma/issues/3548)
- [PANIC in query-engine/connectors/sql-query-connector/src/query_builder/write.rs:22:56called `Option::unwrap()` on a `None` value](https://github.com/prisma/prisma/issues/5966)
- [Improve readability of errors in `prisma migrate deploy`](https://github.com/prisma/prisma/issues/6054)
- [Introspection creates invalid schema: "Error parsing attribute "default": The `autoincrement()` default value is used on a non-indexed field even though the datasource does not support this."](https://github.com/prisma/prisma/issues/6477)
- [Error: [libs/sql-schema-describer/src/sqlite.rs:452:76] get name](https://github.com/prisma/prisma/issues/6499)
- [Soft reset crash with custom user types on SQL Server](https://github.com/prisma/prisma/issues/6526)
- [`migrate dev` with shadow database errors with "Database already exists FK__Address__userId" when migration fails because of existing foreign key](https://github.com/prisma/prisma/issues/6547)


Prisma Client

- [Test support for PlanetScale/Vitess](https://github.com/prisma/prisma/issues/5219)
- [SQLServer decimal(26,0) causes PANIC in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tiberius-0.5.9/src/tds/numeric.rs:288:47](https://github.com/prisma/prisma/issues/5950)
- [Cannot read property 'collectErrors' of null](https://github.com/prisma/prisma/issues/6052)
- [Prisma client runtime causes "Critical dependency" warning in Webpack](https://github.com/prisma/prisma/issues/6327)
- [Prisma is not compatible with Next.js webpack5 opt-in](https://github.com/prisma/prisma/issues/6328)
- [No results when using cursor and orderBy (Text type)](https://github.com/prisma/prisma/issues/6337)
- [Decimal value stored in MySql DB with floating point error](https://github.com/prisma/prisma/issues/6381)
- [napi engine cause OOMKilled in container environment](https://github.com/prisma/prisma/issues/6474)
- [Netlify Functions deploy fails with Prisma because of size problems, Prisma deploys with 2 QE binaries](https://github.com/prisma/prisma/issues/6503)
- [Misleading validation error on MongoDB connection strings](https://github.com/prisma/prisma/issues/6539)
- [Integrate feature flag changes in Prisma Client](https://github.com/prisma/prisma/issues/6575)
- [MaxListenersExceededWarning: prisma 2.20.x and above](https://github.com/prisma/prisma/issues/6584)
- [Prisma Client crashes with Node.js 16.0.0](https://github.com/prisma/prisma/issues/6682)


Prisma Studio

- [Unable to find query engine](https://github.com/prisma/studio/issues/659)


Prisma engines

- [Vitess test runs into mergeable state](https://github.com/prisma/prisma-engines/issues/1851)

Credits

Huge thanks to Sytten, schiller-manuel, mongolyy, paularah, Iamshankhadeep, meeq for helping!

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

Learn about the latest release and other news from the Prisma community by joining us for another ["What's new in Prisma"](https://www.youtube.com/watch?v=zBIQUdqgfJM&ab_channel=Prisma) livestream.

The stream takes place [on Youtube](https://www.youtube.com/watch?v=zBIQUdqgfJM&ab_channel=Prisma) on **Thursday, May 06** at **5pm Berlin | 8am San Francisco**.

2.21.2

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

Fix

Prisma Client
- [MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 6584](https://github.com/prisma/prisma/issues/6584)
- [Netlify Functions deploy fails with Prisma because of size problems, Prisma deploys with 2 QE binaries
6503](https://github.com/prisma/prisma/issues/6503)
If the issue persists when deploying to Netlify, we recommend manually clearing Netlify's build cache from the ‘Deploys’ menu. Under ‘Trigger deploy’, you’ll see ‘Clear cache and deploy site’.

Page 18 of 44

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.