nestjs-prisma-crud
nestjs-prisma-crud copied to clipboard
fix(deps): update prisma monorepo to v5.20.0
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @prisma/client (source) | 5.19.1 -> 5.20.0 |
||||
| prisma (source) | 5.19.1 -> 5.20.0 |
Release Notes
prisma/prisma (@prisma/client)
v5.20.0
🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release. 🌟
Highlights
strictUndefinedChecks in Preview
With Prisma ORM 5.20.0, the Preview feature strictUndefinedChecks will disallow any value that is explicitly undefined and will be a runtime error. This change is direct feedback from this GitHub issue and follows our latest proposal on the same issue.
To demonstrate the change, take the following code snippet:
prisma.table.deleteMany({
where: {
// If `nullableThing` is nullish, this query will remove all data.
email: nullableThing?.property,
}
})
In Prisma ORM 5.19.0 and below, this could result in unintended behavior. In Prisma ORM 5.20.0, if the strictUndefinedChecks Preview feature is enabled, you will get a runtime error instead:
Invalid \`prisma.user.findMany()\` invocation in
/client/tests/functional/strictUndefinedChecks/test.ts:0:0
XX })
XX
XX test('throws on undefined input field', async () => {
→ XX const result = prisma.user.deleteMany({
where: {
email: undefined
~~~~~~~~~
}
})
Invalid value for argument \`where\`: explicitly \`undefined\` values are not allowed."
We have also introduced the Prisma.skip symbol, which will allow you to get the previous behavior if desired.
prisma.table.findMany({
where: {
// Use Prisma.skip to skip parts of the query
email: nullableEmail ?? Prisma.skip
}
})
From Prisma ORM 5.20.0 onward, we recommend enabling strictUndefinedChecks, along with the TypeScript compiler option exactOptionalPropertyTypes, which will help catch cases of undefined values at compile time. Together, these two changes will help protect your Prisma queries from potentially destructive behavior.
strictUndefinedChecks will be a valid Preview feature for the remainder of Prisma ORM 5. With our next major version, this behavior will become the default and the Preview feature will be “graduated” to Generally Available.
If you have any questions or feedback about strictUndefinedChecks, please ask/comment in our dedicated Preview feature GitHub discussion.
typedSql bug fix
Thank you to everyone who has tried out our typedSql Preview feature and provided feedback! This release has a quick fix for typescript files generated when Prisma Schema enums had hyphens.
Fixes and improvements
Prisma
- Prisma incorrectly parses CRDB's FK constraint error as
not available. - Invalid TypeScript files created by
generatewhen typedSql is enabled and enum contains hyphens. @prisma/internalsdidn't listts-toolbeltin dependencies.- using
$extendsprevents model comments from being passed to TypeScript
Prisma Engines
Credits
Huge thanks to @mcuelenaere, @pagewang0, @key-moon, @pranayat, @yubrot, @thijmenjk, @mydea, @HRM, @haaawk, @baileywickham, @brian-dlee, @nickcarnival, @eruditmorina, @nzakas, and @gutyerrez for helping!
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 99.30%. Comparing base (
ac6e094) to head (741ca75). Report is 16 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #864 +/- ##
=======================================
Coverage 99.30% 99.30%
=======================================
Files 17 17
Lines 434 434
Branches 86 85 -1
=======================================
Hits 431 431
Misses 3 3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.