fix(deps): update prisma monorepo to v5.13.0
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
@prisma/client (source) | dependencies | minor | 5.12.1 -> 5.13.0 |
prisma (source) | devDependencies | minor | 5.12.1 -> 5.13.0 |
⚠ WarningSome dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
prisma/prisma (@prisma/client)
v5.13.0
Today, we are excited to share the 5.13.0
stable release
Highlights
omit
fields from Prisma Client queries (Preview)
We’re excited to announce Preview support for the omit
option within the Prisma Client query options. The highly-requested omit
feature now allows you to exclude fields that you don’t want to retrieve from the database on a per-query basis.
By default, when a query returns records, the result includes all scalar fields of the models defined in the Prisma schema. select
can be used to return specific fields, while omit
can now be used to exclude specific fields. omit
lives at the same API level and works on all of the same Prisma Client model queries as select
. Note, however, that omit
and select
are mutually exclusive. In other words, you can’t use both in the same query.
To get started using omit
, enable the omitApi
Preview feature in your Prisma schema:
// schema.prisma
generator client {
provider = "prisma-client-js"
previewFeatures = ["omitApi"]
}
Be sure to re-generate Prisma Client afterwards:
npx prisma generate
Here is an example of using omit
:
// Includes all fields except password
await prisma.user.findMany({
omit: {
password: true
},
})
Here is an example of using omit
with include
:
// Includes all user fields except user's password and title of user's posts
await prisma.user.findMany({
omit: {
password: true
},
include: {
posts: {
omit: {
title: true
},
},
},
})
Expand to view the example Prisma schema
model User {
id Int @​id @​default(autoincrement())
email String @​unique
name String?
password String
posts Post[]
}
model Post {
id Int @​id @​default(autoincrement())
title String
author User @​relation(fields: [authorId], references: [id])
authorId Int
}
Many users have requested a global implementation of omit
. This request will be accommodated in the future. In the meantime, you can follow the issue here.
omitApi
Preview feature
omit
- Prisma Client API Reference
Fixes and improvements
Prisma Migrate
Prisma Client
- MySQL
upsert()
:Internal error: Attempted to serialize empty result.
- Mysql
upsert()
fails with "Attempted to serialize empty result." - Interactive Transaction API timing out after upgrading from 4.7.0 and above
- MySQL and SQLite
upsert()
:Internal error: Attempted to serialize empty result.
- MySQL
upsert()
:Internal error: Attempted to serialize empty result.
- MongoDB
upsert()
:Internal error: Attempted to serialize empty result.
- MongoDB
upsert()
:Internal error: Attempted to serialize empty result
- Relation mode +
upsert()
:Internal error: Attempted to serialize empty result.
Internal error: Attempted to serialize empty result.
onupsert()
forupdate
case in different databases (when usingrelationMode=prisma
explicitly or implicitly [MongoDB])- Postgres
upsert(): Internal error: Attempted to serialize empty result
whenrelationMode = "prisma"
is used ✘ [ERROR] near "��": syntax error at offset 0
when runningwrangler d1 migrations apply
with Prisma generated migration (on Windows, using Powershell)
Credits
Huge thanks to @ospfranco, @pranayat, @yubrot, @skyzh, @anuraaga, @yehonatanz, @arthurfiorette, @elithrar, @tockn, @Kuhave, @obiwac for helping!
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.