Commit a90e9e5
authored
fix(deps): update prisma monorepo to v5.1.0 (#9001)
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@prisma/client](https://www.prisma.io)
([source](https://github.com/prisma/prisma)) | [`5.0.0` ->
`5.1.0`](https://renovatebot.com/diffs/npm/@prisma%2fclient/5.0.0/5.1.0)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
| [@prisma/internals](https://www.prisma.io)
([source](https://github.com/prisma/prisma)) | [`5.0.0` ->
`5.1.0`](https://renovatebot.com/diffs/npm/@prisma%2finternals/5.0.0/5.1.0)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
| [prisma](https://www.prisma.io)
([source](https://github.com/prisma/prisma)) | [`5.0.0` ->
`5.1.0`](https://renovatebot.com/diffs/npm/prisma/5.0.0/5.1.0) |
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
[](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
<details>
<summary>prisma/prisma (@​prisma/client)</summary>
### [`v5.1.0`](https://github.com/prisma/prisma/releases/tag/5.1.0)
[Compare
Source](https://github.com/prisma/prisma/compare/5.0.0...5.1.0)
Today, we are excited to share the `5.1.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%20@​prisma%20release%20v5.1.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.1.0) about
the release.**
##### Highlights
After two big releases where we released Client extensions for
production usage
([`4.16.0`](https://github.com/prisma/prisma/releases/tag/4.16.0)) and
made Prisma faster by default
([`5.0.0`](https://github.com/prisma/prisma/releases/tag/5.0.0)), we
have focused on some smaller issues to make the experience with these
new features even better.
##### Community contributions
Our community has been on the roll! We appreciate everyone who helps us
by opening a GitHub issue or proposing a fix via Pull Requests. In this
release, we're excited to highlight multiple community contributions:
- Fix IPv6 not working for relational databases:
[https://github.com/prisma/prisma-engines/pull/4051](https://github.com/prisma/prisma-engines/pull/4051)
by [@​alula](https://github.com/alula)
- Middlewares: Add to `PrismaAction` type, missing
`findUniqueOrThrow` and `findFirstOrThrow`
[https://github.com/prisma/prisma/pull/17471](https://github.com/prisma/prisma/pull/17471)
by [@​mejiaej](https://github.com/mejiaej) and missing `groupBy`
[https://github.com/prisma/prisma/pull/19985](https://github.com/prisma/prisma/pull/19985)
by [@​iurylippo](https://github.com/iurylippo)
- Better error message in currently non-supported runtimes like Browser
or Vercel Edge Runtime
[https://github.com/prisma/prisma/pull/20163](https://github.com/prisma/prisma/pull/20163)
by [@​andyjy](https://github.com/andyjy)
- Remove error messages for valid NixOS setups
[https://github.com/prisma/prisma/pull/20138](https://github.com/prisma/prisma/pull/20138)
by [@​Gerschtli](https://github.com/Gerschtli)
##### Better performance: Fewer SQL queries on PostgreSQL & CockroachDB
In our continued and ongoing work to make Prisma faster, we identified
some Prisma Client queries that led to multiple SQL statements being
executed — although in specific databases, that was not necessary.
Hence we optimized our internal SQL generation for PostgreSQL and
CockroachDB to generate more efficient SQL queries:
##### Simple `create` query
In a simple `create` query, `RETURNING` makes the second query and the
transaction statements obsolete:
##### Prisma Client query
```ts
prisma.user.create({
data: { name: "Original name" }
})
```
##### Before v5.1.0
```sql
BEGIN
INSERT INTO "User" ("name") VALUES ($1) RETURNING "User"."id"
SELECT "User"."id", "User"."name" FROM "User" WHERE "User"."id" = $1;
COMMIT
```
##### 5.1.0 and later
```sql
-- Sends 1 statement (instead of 2) and omits the transaction
INSERT INTO "User" ("name") VALUES ($1) RETURNING "User"."id", "User"."name"
```
##### Simple `update` query
For a simple `update` query, `RETURNING` makes both additional queries
and the transaction statements obsolete:
##### Prisma Client query
```ts
prisma.user.update({
where: { id: 1 },
data: { name: "updated" }
})
```
##### Before v5.1.0
```sql
BEGIN
SELECT id FROM "User" WHERE "User".id = 1;
UPDATE "User" SET name = 'updated' WHERE "User".id = 1;
SELECT id, name FROM "User" WHERE "User".id = 1;
COMMIT
```
##### 5.1.0 and later
```sql
-- Sends 1 statement (instead of 3) and omits the transaction
UPDATE "User" SET name = 'updated' WHERE "User".id = 1 RETURNING "User".id, "User".name;
```
##### Simple `update` query, return with relation value
One `SELECT` query could easily be dropped in a simple `update` query
that should return a relation value as well:
##### Prisma Client query
```ts
prisma.user.update({
where: { id: 1 },
data: { name: "updated" },
includes: { posts: true }
})
```
##### Before v5.1.0
```sql
BEGIN
SELECT id FROM "User" WHERE "User".id = 1;
UPDATE "User" SET name = 'updated' WHERE "User".id = 1;
SELECT id, name FROM "User" WHERE "User".id = 1;
SELECT id, title FROM "Post" WHERE "Post"."userId" = 1;
COMMIT
```
##### 5.1.0 and later
```sql
-- Sends 3 statements (instead of 4)
BEGIN
UPDATE "User" SET name = 'updated' WHERE "User".id = 1 RETURNING "User".id;
SELECT id, name FROM "User" WHERE "User".id = 1;
SELECT id, title FROM "Post" WHERE "Post"."userId" = 1;
COMMIT
```
##### Empty `update` query
An empty `update` query can be optimized to skip the transaction and the
second identical query by creating specific handling for this edge case
in our code:
##### Prisma Client query
```ts
prisma.user.update({
where: { id: 1 },
data: {},
})
```
##### Before v5.1.0
```sql
BEGIN
SELECT id, name FROM "User" WHERE "User".id = 1;
SELECT id, name FROM "User" WHERE "User".id = 1;
COMMIT
```
##### 5.1.0 and later
```sql
-- Sends 1 statement (instead of 2) and omits the transaction
SELECT id, name FROM "User" WHERE "User".id = 1;
```
##### Simple + relation `update` query (but do not return relation
value)
An update of both the model and its relation, we could drop 2 `SELECT`
queries that we did before without ever using their return values:
##### Prisma Client query
```ts
prisma.user.update({
where: { id: 1 },
data: {
name: "updated",
posts: {
update: {
where: { id: 1 },
data: {
title: "updated"
}
}
}
}
})
```
##### Before v5.1.0
```sql
BEGIN
SELECT id, name FROM "User" WHERE "User".id = 1;
UPDATE "User" SET name = 'updated' WHERE "User".id = 1 RETURNING "User".id;
SELECT "id", "postId" FROM "Post" WHERE "Post".id = 1;
UPDATE "Post" SET title = 'updated' WHERE "Post"."userId" = 1 AND "Post".id = 1;
SELECT id, name FROM "User" WHERE "User".id = 1;
COMMIT
```
##### 5.1.0 and later
```sql
-- Sends 3 statements (instead of 5)
BEGIN
UPDATE "User" SET name = 'updated' WHERE "User".id = 1 RETURNING "User".id, "User".name;
SELECT "id", "postId" FROM "Post" WHERE "Post".id = 1;
UPDATE "Post" SET title = 'updated' WHERE "Post"."userId" = 1 AND "Post".id = 1;
COMMIT
```
In the next releases, we will continue optimizing Prisma Client queries
to only run the minimal amount of SQL queries necessary.
If you notice any Prisma Client queries that are affected right now,
please check the issues under [our `performance/queries`
label](https://github.com/prisma/prisma/labels/topic%3A%20performance%2Fqueries).
If you didn’t find one for what you’re seeing, please [create a new
issue](https://github.com/prisma/prisma/issues). This will be super
useful for us to understand all (edge) cases. Thank you!
##### Prisma Studio now supports `directUrl`
Our CLI command `prisma studio` that opens Prisma Studio now also can
use the
[`directUrl`](https://www.prisma.io/docs/guides/performance-and-optimization/connection-management#external-connection-poolers)
property of the `datasource` block so you can make it talk to a
different database than defined in `url`. This makes it easier to use
Studio alongside the Prisma Data Proxy and
[Accelerate](https://www.prisma.io/accelerate).
##### Prisma Client: No more type clashes
We fixed (almost) all cases where using a specific term as a model name
in your Prisma Schema would lead to a *type clash* due to Prisma’s
generated typings. As a result of a type clash, it was not possible to
use that model in your code (this was e.g. the case if you named a model
`Model` or `ModelUpdate`).
We also deprecated the `<ModelName>Args` type as part of that fix. Going
forward, `<ModelName>DefaultArgs` should be used instead.
##### Fixes and improvements
##### Prisma Client
- [Reduce the number of generated SQL statements for
Updates/Inserts](https://github.com/prisma/prisma/issues/5043)
- [\[v2.17.0\] Missing client TS types
Aggregate\*Args](https://github.com/prisma/prisma/issues/5749)
- [Reduce transactions for
writes](https://github.com/prisma/prisma/issues/5919)
- [Incorrect Include typings when having models called `X` and
`XUpdate`](https://github.com/prisma/prisma/issues/7518)
- [Model named "Check" is incorrectly
typed](https://github.com/prisma/prisma/issues/7655)
- [Models named Query cause an internal GraphQL Parse
Error](https://github.com/prisma/prisma/issues/8153)
- [Naming an entity "Query" leads to an
error](https://github.com/prisma/prisma/issues/9307)
- [Type name clash when `Model` and `ModelUpdate` is defined in the
schema ](https://github.com/prisma/prisma/issues/9568)
- [Duplicate identifier
'CheckSelect'](https://github.com/prisma/prisma/issues/9669)
- [`@prisma/internals` (previously @​prisma/sdk) uses deprecated
dependencies `[email protected]` via `temp-write
4.0.0`](https://github.com/prisma/prisma/issues/11960)
- [naming a model `Datasource` breaks generated return
types](https://github.com/prisma/prisma/issues/12332)
- [Certain `model` names cause clashes in generated
types](https://github.com/prisma/prisma/issues/12469)
- [Type error on query with select field (although query runs
successfully)](https://github.com/prisma/prisma/issues/15615)
- [`$extends` TS error: "Inferred type of this node exceeds the maximum
length the compiler will serialize" with `"declaration": true` in
`tsconfig`](https://github.com/prisma/prisma/issues/16536)
- [Update operation includes multiple where statements for the same
fields](https://github.com/prisma/prisma/issues/16864)
- [Type conflict when naming a table {something} and a second table
{something}Result ](https://github.com/prisma/prisma/issues/16940)
- [`Type '"findUniqueOrThrow"' is not assignable to type
'PrismaAction'`](https://github.com/prisma/prisma/issues/17470)
- [Naming a model `Promise` breaks types for
`PrismaPromise`](https://github.com/prisma/prisma/issues/17542)
- [Prisma can't connect with an IPv6 host (on e.g.
Fly.io)](https://github.com/prisma/prisma/issues/18079)
- [`include` not working on models ending with `...Update` with unique
compound index](https://github.com/prisma/prisma/issues/18902)
- [Prisma Client: fixing type name clashes from generated
client](https://github.com/prisma/prisma/issues/19811)
- [Prisma Client: wrong type when using spread operator to set default
values on query args](https://github.com/prisma/prisma/issues/19962)
- [The generated updateArgs have no update
attribute](https://github.com/prisma/prisma/issues/19967)
- [4.16.1 breaks type
check](https://github.com/prisma/prisma/issues/19999)
- [`LogLevel` enum conflicts with built-in Prisma
type](https://github.com/prisma/prisma/issues/20031)
- [Using `Prisma.XyzFindManyArgs` breaks `findMany` typing in
v4.16.0+](https://github.com/prisma/prisma/issues/20093)
- [`this.$on("beforeExit")` doesn't work anymore on
5.0.0](https://github.com/prisma/prisma/issues/20171)
- [Wrong nullable types with fluent API in Prisma
5.0](https://github.com/prisma/prisma/issues/20183)
- [`Error: Unknown value type` on nested
create](https://github.com/prisma/prisma/issues/20192)
- [Prisma 5.0 Migration `findUnique` on `@unique` columns that are
enums](https://github.com/prisma/prisma/issues/20227)
- [`<Tablename>UpsertArgs` select field does not match type for
`db.<tablename>.upsert(item)`](https://github.com/prisma/prisma/issues/20243)
- [TypeScript Error TS2322 when assigning JavaScript Date object to
Prisma DateTime field](https://github.com/prisma/prisma/issues/20253)
- [npm install of Prisma CLI fails on preinstall with no logs when
Node.js version is lower than
minimum](https://github.com/prisma/prisma/issues/20260)
- [Types wrongly accept non-array parameter `by` in `groupBy` in
5.0.0](https://github.com/prisma/prisma/issues/20261)
- [CLI errors with `TypeError [ERR_INVALID_URL]: Invalid URL` when
`HTTP(S)_PROXY` en var has is set to a URL without a
protocol](https://github.com/prisma/prisma/issues/20302)
- [`tsc --watch` fails with `JavaScript heap out of memory`
error](https://github.com/prisma/prisma/issues/20308)
- [Hovering over types (intellisense) shows confusing
`GetResult`](https://github.com/prisma/prisma/issues/20320)
- [Internal query batching fails when the table name is
'stores'](https://github.com/prisma/prisma/issues/20324)
- [Client extensions: result extensions should be applied after query
extensions](https://github.com/prisma/prisma/issues/20437)
##### Prisma Studio
- [Use `directUrl` in `prisma
studio`](https://github.com/prisma/prisma/issues/17358)
##### Language tools (e.g. VS Code)
- [The extension for VS Code ignores the modern telemetry
flag](https://github.com/prisma/language-tools/issues/1463)
- [Prisma VS Code extension with mongodb provider crashes when a
relation field/type is not defined
](https://github.com/prisma/language-tools/issues/1466)
- [Editing schema.prisma results in wasm
panics](https://github.com/prisma/language-tools/issues/1473)
##### Credits
Huge thanks to [@​skyzh](https://github.com/skyzh),
[@​alula](https://github.com/alula),
[@​michaelpoellath](https://github.com/michaelpoellath),
[@​RobertCraigie](https://github.com/RobertCraigie),
[@​Gerschtli](https://github.com/Gerschtli),
[@​andyjy](https://github.com/andyjy),
[@​mejiaej](https://github.com/mejiaej),
[@​iurylippo](https://github.com/iurylippo),
[@​mrazauskas](https://github.com/mrazauskas) for helping!
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/redwoodjs/redwood).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzYuMjcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>1 parent fadf121 commit a90e9e5
File tree
5 files changed
+92
-119
lines changed- packages
- api
- cli
- record
- structure
5 files changed
+92
-119
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments