[Snyk] Upgrade @prisma/client from 5.8.0 to 5.15.0 #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was automatically created by Snyk using the credentials of a real user.
![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)
Snyk has created this PR to upgrade @prisma/client from 5.8.0 to 5.15.0.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
The recommended version is 761 versions ahead of your current version.
The recommended version was released on 21 days ago.
Release notes
Package name: @prisma/client
Today, we are excited to share the
5.15.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Multi-File Prisma Schema support
Prisma ORM 5.15.0 features support for multi-file Prisma Schema in Preview.
This closes a long standing issue and does so in a clean and easy to migrate way.
To get started:
prismaSchemaFolder
Preview feature by including it in thepreviewFeatures
field of yourgenerator
.provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["prismaSchemaFolder"]
}
schema
subdirectory under yourprisma
directory.schema.prisma
into this directory.You are now set up with a multi-file Prisma Schema! Add as many or as few
.prisma
files to the newprisma/schema
directory.When running commands where a Prisma Schema file is expected to be provided, you can now define a Prisma Schema directory. This includes Prisma CLI commands that use the
--schema
option as well as defining schema viapackage.json
Our tooling has also been updated to handle multiple Prisma Schema files. This includes our Visual Studio Code extension and tools like database introspection, which will deposit new models in a
introspected.prisma
file. Existing models will be updated in the file they are found.To learn more, please refer to our official documentation and announcement blog post. If you try out
prismaSchemaFolder
, please let us know!Interesting Bug Fixes
Fix for PostgreSQL prepared statement caching for raw queries
This release fixes a nasty bug with the caching of prepared statements in raw Prisma Client queries that affected PostgreSQL when you ran the same SQL statement with differently typed paramters. This should not fail any more.
Fix for SQL Server introspection of (deprecated)
CREATE DEFAULT
Our Introspection logic crashed on encountering certain multi-line
CREATE DEFAULT
, a deprecated way to define defaults in SQL Server. As many SQL Server users are working with established databases, this happened frequently enough that we now explicitly ignore these defaults instead of crashing.Fix for Cloudflare D1’s lower parameter limit
Cloudflare’s D1 has a lower parameter limit than local SQLite, which caused bigger queries to fail. We adapted that limit to the D1 default for
@ prisma/adapter-d1
, which will avoid such failures.Fix for Cloudflare D1’s different
PRAGMA
supportOur generated migration SQL for SQLite did not always work for Cloudflare D1, because of differences in the supported pragmas. We adapted the SQL to work in both local SQLite and Cloudflare D1.
Fixes and improvements
Prisma Migrate
Result::unwrap()
on anErr
value: "Couldn't parse default value:create default [dbo].[member_notification_cancel_flags] as 0\r\n
"Result::unwrap()
on anErr
value: "Couldn't parse default value:create default d_password as 'D,73'
"DEFAULT
sResult::unwrap()
on anErr
value: "Couldn't parse default value:\r\ncreate default D_BIT_OFF\r\nas 0\r\n
"Result::unwrap()
on anErr
value: "Couldn't parse default value in SQL ServerError: [libs\sql-schema-describer\src\mssql.rs:336:30] called
Result::unwrap()on an
Errvalue: "Couldn't parse default value: [...]
Result::unwrap()
on anErr
value: "Couldn't parse default value:\r\ncreate default [va_nulla] as 0\r\n
"db pull
can't parse script setting default valuePrisma Client
22P03
. Message:db error: ERROR: incorrect binary data format in bind parameter 1
incorrect binary data format in bind parameter 1
incorrect binary data format in bind parameter x
)_count
leads to errorwarn(prisma-client) This is the 10th instance of Prisma Client being started.
warning in Edge (and potentially) other envs)incorrect binary data format in bind parameter 6
Inconsistent column data: Unexpected conversion failure from Number to BigInt
error when using@prisma/adapter-pg
Int
switched to beingInt32
for MongoDBLanguage tools (e.g. VS Code)
Generate
codelens fails on WindowsCredits
Huge thanks to @ pranayat, @ yubrot, and @ skyzh for helping!
Today, we are excited to share the
5.14.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release. 🌟
Highlights
Share your feedback about Prisma ORM
We want to know how you like working with Prisma ORM in your projects! Please take our 2min survey and let us know what you like or where we can improve 🙏
createManyAndReturn()
We’re happy to announce the availability of a new, top-level Prisma Client query:
createManyAndReturn()
. It works similarly tocreateMany()
but uses aRETURNING
clause in the SQL query to retrieve the records that were just created.Here’s an example of creating multiple posts and then immediately returning those posts.
const posts = prisma.post.createManyAndReturn({
data: postBodies
});
return posts
Additionally,
createManyAndReturn()
supports the same options asfindMany()
, such as the ability to return only specific fields.const postTitles = prisma.post.createManyAndReturn({
data: postBodies,
select: {
title: true,
},
});
return postTitles
Full documentation for this feature can be found in the Prisma Client API Reference.
Note: Because
createManyAndReturn()
uses theRETURNING
clause, it is only supported by PostgreSQL, CockroachDB, and SQLite databases. At this time,relationLoadStrategy: join
is not supported increateManyAndReturn()
queries.MongoDB performance improvements
Previously, Prisma ORM suffered from performance issues when using the
in
operator or when including related models in queries against a MongoDB database. These queries were translated by the Prisma query engine in such a way that indexes were skipped and collection scans were used, leading to slower queries especially on large datasets.With 5.14.0, Prisma ORM now rewrites queries to use a combination of
$or
and$eq
operators, leading to dramatic performance increases for queries that includein
operators or relation loading.Fixes and improvements
Prisma Client
createMany()
should return the created recordstake
on many-to-one relationshipinclude
for relationsfindMany()
query execution within
include
query slowonDelete: SetNull
prisma init --with-model
@ opentelemetry/*
dependenciesThe required connected records were not found.
when using indicesPrisma Migrate
dbgenerated()
still breaking forUnsupported()
typesshadowDatabaseUrl
is identical tourl
(ordirectUrl
)PRAGMA foreign_key_check;
Language tools (e.g. VS Code)
Company news
Prisma Changelog
Curious about all things Prisma? Be sure to check out the Prisma Changelog for updates across Prisma's products, including ORM, Accelerate, and Pulse!
New product announcement: Prisma Optimize
With this release, we are excited to introduce a new Prisma product. We’re calling it “Optimize” because that’s what it does! Let your favorite ORM also help you debug the performance of your application.
Check out our announcement blog post for more details, including a demo video.
Credits
Huge thanks to @ pranayat, @ yubrot, @ skyzh, @ anuraaga, @ gutyerrez, @ avallete, @ ceddy4395, @ Kayoshi-dev for helping!
Today, we are excited to share the
5.13.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or posting on X about the 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-requestedomit
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, whileomit
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 asselect
. Note, however, thatomit
andselect
are mutually exclusive. In other words, you can’t use both in the same query.To get started using
omit
, enable theomitApi
Preview feature in your Prisma schema:Be sure to re-generate Prisma Client afterwards:
Here is an example of using
omit
:Here is an example of using
omit
withinclude
:Expand to view the example Prisma schema
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.📣 Share your feedback:
omitApi
Preview feature📚 Documentation:
omit
- Prisma Client API ReferenceFixes and improvements
Prisma Migrate
Prisma Client
upsert()
:Internal error: Attempted to serialize empty result.
upsert()
fails with "Attempted to serialize empty result."upsert()
:Internal error: Attempted to serialize empty result.
upsert()
:Internal error: Attempted to serialize empty result.
upsert()
:Internal error: Attempted to serialize empty result.
upsert()
:Internal error: Attempted to serialize empty result
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])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!
Today, we are issuing the
5.12.1
patch release to fix two small problems with our new Cloudflare D1 support.Fixes in Prisma CLI
Windows-only fix for new D1 specific flags for
migrate diff
anddb pull
The flags
--from-local-d1
and--to-local-d1
formigrate diff
and--local-d1
todb pull
we added in 5.12.0 were not working as expected when running on Windows only. This is now fixed.📚 Documentation: Deploying a Cloudflare worker with D1 and Prisma ORM
New option for
migrate diff
:-o
or--output
We added a new parameter
--output
tomigrate diff
that can be used to provide a filename into which the output of the command will be written. This is particularly useful for Windows users, using PowerShell, as using>
to write into a file creates a UTF-16 LE file that can not be read bywrangler d1 migrations apply
. Using this new option, this problem can be avoided:Related issues:
✘ [ERROR] near "��": syntax error at offset 0
when runningwrangler d1 migrations apply
with Prisma generated migration (on Windows, using PowerShell) #23702prisma migrate resolve --applied
not working on new project,migration ... could not be found.
Today, we are excited to share the
5.12.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release.
Highlights
Cloudflare D1 (Preview)
This release brings Preview support for