fix(deps): update prisma monorepo to v5 (major) #48
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 contains the following updates:
4.16.2
->5.7.0
4.16.2
->5.7.0
Release Notes
prisma/prisma (@prisma/client)
v5.7.0
Compare Source
v5.6.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Driver adapters improvements (Preview)
In version 5.4.0, we released
driverAdapters
into Preview. ThedriverAdapters
feature enables Prisma Client to access your database using JavaScript or Serverless database drivers.In this release, we fixed many bugs for the existing driver adapters. We appreciate all the community feedback that has helped us improve this feature!
PlanetScale serverless driver adapter improvements
This release also introduces a small breaking change to the
@prisma/adapter-planetscale
package to improve its stability and performance. The serverless driver adapter will now use a connection pool instead of a single connection from PlanetScale’s serverless driver.In case you’re using the
@prisma/adapter-planetscale
, update your Prisma Client instance with the following:Request for feedback
We encourage you to try out the driver adapters and share your feedback to help us move it to General Availability in either of the following GitHub discussions:
Refer to our docs to learn more about driver adapters.
New
prisma debug
commandThis release introduces a new command:
prisma debug
. The command provides debugging information such as environment variables that Prisma Client, Prisma Migrate, Prisma CLI, and Prisma Studio use. The command is also useful when creating a bug report as the information complements the output of theprisma -v
command.You can learn more about the command in our docs.
Read replicas extension improvements
We also released version 0.3.0 of the
@prisma/extension-read-replicas
package that contains the following improvements:A new
$replica()
method that explicitly enables you to use a replica for your query.For example, by default, the
queryRaw
andexecuteRaw
methods are forwarded to the primary database, as they could try to write to the database. You can use the$replica()
method with either of the*Raw
methods to explicitly execute your query against a replica instead of your primary database.Validation for when there’s an empty list of replicas.
Webpack bundling fixes
We want to thank you, our community members, for your contributions! 🙏
You can find additional information on the changes in the extension’s release. You can learn more about the extension in the announcement blog post.
Package provenance
npm has introduced provenance statements to improve supply-chain security and transparency of packages. This allows developers to verify where and how packages are built.
Starting with the 5.6.0 release, all npm packages for Prisma ORM will be published with provenance statements. If you maintain a Prisma Client extension or generator, we encourage you to enable provenance statements when publishing to npm.
Fixes and improvements
Prisma Migrate
db push
with invalid connection string: Connection string redacted, weird grammardb pull --url=...
logs full connection string onP4001 The introspected database was empty
Prisma Client
prisma_pool_connections_idle
reports misleading number@prisma/adapter-planetscale
PrismaPlanetScale
adapter to the constructorError: sha256 checksum of https://binaries.prisma.sh/all_commits/475c616176945d72f4330c92801f0c5e6398dc0f/windows/query_en gine.dll.node.gz (zipped) should be 748d039badd0919d022fff7d554b66b6937b79035861a6ae9a80c5a95eee76f5 but is b867ad335ee6f58c6a38f665dd641c95e6adff3061f92b7613c62cae1c3362bb
Prisma CLI
prisma debug
Credits
Huge thanks to @onichandame, @LucianBuzzo, @RobertCraigie, @fqazi, @KhooHaoYit, @alencardc, @Oreilles, @christianledgard, @skyzh, @alula, @luxaritas, @Nasfame, @lukahartwig, @steebchen, @icanipa for helping!
Miscellaneous
Prisma Accelerate is now Generally Available
We're excited to share that Prisma Accelerate is now Generally Available. Prisma Accelerate is a global database cache that's available in over 280 locations and provides scalable connection pooling for serverless and edge applications.
Learn more in the announcement blog post. Sign up and try out Prisma Accelerate
💼 We’re hiring!
If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.
We're hiring for an Engineering Manager: Prisma Data Platform.
v5.5.2
Compare Source
Today, we are issuing the
5.5.2
patch release.Fix in Prisma CLI
v5.5.1
Compare Source
Today, we are issuing the
5.5.1
patch release.Fix in Prisma Client
v5.5.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Serverless database drivers improvements and request for feedback (Preview)
In version 5.4.0, we released
driverAdapters
into Preview. ThedriverAdapter
feature enables Prisma Client to access your database using other JavaScript or Serverless database drivers such as Neon, PlanetScale, and Turso.The driver adapters allow Prisma Client to connect to your database using protocols besides TCP, such as HTTP (PlanetScale and Turso) and WebSockets (Neon). You can learn more about the Preview feature from the announcement blog post.
In this release, we focused our efforts on fixing bugs and improving the stability of the Preview feature.
We encourage you to try it out and share your feedback to help us move it to General Availability in either of the following GitHub discussions:
New flags for the
prisma init
commandThis release introduces 3 new flags you can provide when initializing Prisma in your project using the
prisma init
command:--generator-provider
: Defines the default generator to use--preview-features
: Specifies the default Preview features to use in your project--output
: Specifies the default output location for the generated clientFixes and improvements
Prisma CLI
Prisma Client
prisma.model.count
does not typedistinct
correctly….findMany()
invocation: The columnj1.id
does not exist in the current database.Credits
Huge thanks to @onichandame, @fqazi, @KhooHaoYit, @alencardc, @Oreilles, @christianledgard, @skyzh, @alula, @michaelpoellath, @lukahartwig, @steebchen, @icanipa, @jiashengguo, @stephenwade for helping!
💼 We're hiring!
If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.
We're currently hiring for the following roles:
v5.4.2
Compare Source
Today, we are issuing the
5.4.2
patch release.Fix in Prisma Client
v5.4.1
Compare Source
Today, we are issuing the
5.4.1
patch release.Fix in Prisma Client
….findMany()
invocation: The columnj1.id
does not exist in the current database.Fix in
@prisma/adapter-planetscale
v5.4.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Preview support for PlanetScale and Neon serverless database drivers
We’re excited to announce Preview support for the Neon and PlanetScale serverless database drivers. The PlanetScale and Neon serverless database drivers allow Prisma to connect to your database using protocols besides TCP — HTTP (PlanetScale) or WebSockets (Neon).
To get started with the serverless database drivers, first enable the
driverAdapters
Preview feature flag in your Prisma schema:Next, to set up Prisma Client to use the serverless database drivers:
PlanetScale
Install the Prisma adapter for PlanetScale and PlanetScale serverless database driver, and undici:
Ensure you update the host value in your connection string to
aws.connect.psdb.cloud
. You can learn more about this here.DATABASE_URL='mysql://johndoe:[email protected]/clear_nightsky?sslaccept=strict'
Update your Prisma Client instance to use the PlanetScale database driver:
Neon
Install the Prisma adapter for Neon, Neon serverless database driver and undici (WebSockets):
Update your Prisma Client instance to use the Neon serverless database driver:
Let us know your feedback about the Neon or Planetscale serverless database drivers in the linked GitHub discussions. Create a bug report if you run into any issues.
Early Access support for Turso
Turso is an edge-hosted, distributed database that's based on libSQL, an open-source and open-contribution fork of SQLite, enabling you to bring data closer to your application and minimize query latency.
Since support for Turso is in Early Access, there may be some rough edges which we’re still working on it to improve the API and overall support. Additionally, it is behind the
driverAdapters
Preview feature flag. Enable it to get started using Turso in your project:Next, install the Prisma Client adapter for Turso and the
libSQL
database clientUpdate your Prisma Client instance:
You can learn more on how to use Prisma together with Turso in the announcement blog post.
Try it out! Let us know what you think and create a bug report if you run into any issues.
Query performance improvements
In our continued efforts to make Prisma Client faster, we identified and improved the performance of different types of queries.
Relation filters improvements
We made the following improvements to relation filters:
INNER JOIN
used in relation filter queries (Big thank you to @KhooHaoYit for helping out)LEFT JOIN
's for to-one relations. Previously, Prisma made use of sub-queries to fetch data.Example Prisma Client query
Before 5.4.0
After 5.4.0
If you’re interested in more details on the relation query filter improvements, you can take a look at this pull request.
Enum improvements on PostgreSQL and CockroachDB
Previously, when an enum value was used in a query, our Postgres driver would make additional queries to resolve the enum types that were used.
In this release, we’re making improvements by casting enums to
TEXT
to avoid the additional roundtrips when resolving the types.This change should have the most impact if you’re using
pgBouncer
or if you’re running Prisma in a serverless environment, where our Postgres driver can’t cache enum types information.Prisma schema
Prisma Client query
Before 5.4.0
After 5.4.0
Bulk delete improvements
We optimized the
deleteMany
operation by:SELECT
queries used to fetch data that would be used as input for theDELETE
operation. In some cases, this also improves index usage.Prisma Client query
Before 5.4.0
After 5.4.0
Upsert improvements
We improved the
upsert
operation (non-native database upsert) by removing a redundantSELECT
query:Prisma Client query
Before 5.4.0
After 5.4.0
Fixes and improvements
Prisma Client
SELECT
may be generated byupsert()
deleteMany
optimisationUPDATE
, slowing down transaction.deleteMany
seems to send 2 identical read queries first before triggering the actual deleteRustPanic: RuntimeError: panicked at 'internal error: entered unreachable code', query-engine/prisma-models/src/field/scalar.rs:93:50
metrics
propertiesjest-mock-extended
orvitest-mock-extended
expectsnever
inputLanguage tools (e.g. VS Code)
@@​schema
is defined in a block without theschemas
attributePrisma Engines
Credits
Huge thanks to @onichandame, @fqazi, @KhooHaoYit, @alencardc, @Oreilles, @christianledgard, @skyzh, @alula, @michaelpoellath, @RobertCraigie, @icanipa, @jiashengguo, @stephenwade, @darthmaim, @ludralph, @Gerschtli, @andyjy for helping!
💼 We're hiring!
If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.
We're currently hiring for the following roles:
Feel free to read the job descriptions and apply using the links provided.
v5.3.1
Compare Source
Today, we are issuing the
5.3.1
patch release.Fix in Prisma Client
metrics
propertiesv5.3.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
In this sprint, we’ve made bug fixes and overall improvements to Prisma Client. We’ve been working on a few projects that will be announced soon. Stay tuned for the upcoming releases for updates!
Improvements and bug fixes
We made the following changes:
Prisma Client improvements
undefined
values in arrays inJson
fieldsWe added runtime validation for
undefined
values in arrays inJson
fields. Prisma Client will now return an error when an array contains anundefined
value. Therefore, we encourage you to add validation that either removes the value or transforms it tonull
if you stumble on the runtime validation:This release improves Prisma Client’s memory consumption for models with many
@unique
constraints. This was a regression from version 4.10.1, where in some cases, if a model had many unique constraints, Prisma Client would use up a lot of available memory.prisma_pool_connections_open
metric to have a negative value in some cases.Prisma Migrate improvements
prisma db pull
would throw an error. We resolved this, and views are now ignored.PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK
environment variable that enables you to disable advisory locking.VS Code extension improvements
SetDefault
withNoAction
when using MySQL and the default/foreignKeys
relation mode.Fixes and improvements
Prisma Migrate
prisma migrate deploy
:MariaDB doesn't yet support 'GET_LOCK in cluster (WSREP_ON=ON)'
Prisma Client
prisma_pool_connections_open
has a bug where it goes negativeError: socket hang up
on Linux/arm64undefined
from Arrays when using Json fields with PostgresLanguage tools (e.g. VS Code)
SetDefault
withNoAction
whenprovider = "mysql"
andrelationMode = "foreignKeys" | default
Credits
Huge thanks to @alencardc, @Oreilles, @christianledgard, @skyzh, @alula, @michaelpoellath, @RobertCraigie, @stephenwade for helping!
v5.2.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Improved Prisma Client experience for Prisma Accelerate and Data Proxy
In this release, we’ve made the following improvements to Prisma Client when using Prisma Accelerate or Prisma Data Proxy:
Prisma Client will now automatically determine how it should connect to the database depending on the protocol in the connection string. If the connection string starts with
prisma://
, Prisma Client will try to connect to your database using Prisma Accelerate or Prisma Data Proxy.Prisma Studio now works with Prisma Data Proxy and Prisma Accelerate.
We’ve introduced a new
--no-engine
flag which will prevent a Query Engine file from being included in the generated Prisma Client. This flag will also help ensure the bundle size of your application remains small by excluding the Query Engine files from the generated Prisma Client.The
--data-proxy
and--accelerate
flags have not been removed but are now aliases for the new--no-engine
flag.We recommend using the
--no-engine
flag when generating Prisma Client that uses either Accelerate or Data Proxy.Simplified connection string override in Prisma Client
This release simplifies the API used when programmatically overriding the connection string by introducing the
datasourceUrl
property in Prisma Client’s constructor. This means you do not have to use the datasource name defined in your Prisma schema.Query performance improvements
Continuing our work from 5.1.0 we made further performance improvements around the queries Prisma executes, targeting one-to-many relation fields and nested updates.
Use
LIMIT
in one-to-many relations on a single parentIn cases where there is a single parent with a one-to-many relation included (
findFirst
,findUnique
,findMany({ take: 1 })
), we now utilizeLIMIT
at the database level to restrict the number of related items returned instead of retrieving all related items into memory and performing atake
in memory.For situations where you have many related objects but only need a few, you should see a dramatic improvement in speed and memory usage.
Note: we are still working on bringing this improvement to other parts of Prisma Client in upcoming releases. If multiple parent records are returned, the previous behavior is used.
Further improvements for nested writes
Thanks to our introduction of using
RETURNING
in some cases in 5.1.0, we could now improve performance in nested writes by removing reload nodes. This will now result in one less query per relation traversed in a nested write. For more info, check out the pull request.Prisma Client query
Before v5.2.0
5.2.0 and later
Fixes and improvements
Prisma Client
limit
is gone whenfindUnique
with include relationCannot fetch data from service: include is not a function
Error while using Next.js with Data Proxytake
key doesn't work correctly for nested query that returns one item with its nested childrendisconnect: true
does not appear to delete the foreign key in the returned dataneeds
andcount
methodmockDeep<PrismaClient>()
@prisma/client/edge
can not find environment variable<Model>CountOutputTypeDefaultArgs
does not existPrisma Migrate
prisma generate
when Unsupported field defined in a Composite typeCredits
Huge thanks to @skyzh, @alula, @michaelpoellath, @RobertCraigie, @darthmaim, @Gerschtli, @andyjy, @mejiaej, @iurylippo, @mrazauskas, @coder246, @RDIL for helping!
v5.1.1
Compare Source
Today, we are issuing the
5.1.1
patch release.Fixes in Prisma Client
disconnect: true
does not appear to delete the foreign key in the returned dataneeds
andcount
methodv5.1.0
Compare Source
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 about the release.
Highlights
After two big releases where we released Client extensions for production usage (
4.16.0
) and made Prisma faster by default (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:
PrismaAction
type, missingfindUniqueOrThrow
andfindFirstOrThrow
https://github.com/prisma/prisma/pull/17471 by @mejiaej and missinggroupBy
https://github.com/prisma/prisma/pull/19985 by @iurylippoBetter 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
queryIn a simple
create
query,RETURNING
makes the second query and the transaction statements obsolete:Prisma Client query
Before v5.1.0
5.1.0 and later
Simple
update
queryFor a simple
update
query,RETURNING
makes both additional queries and the transaction statements obsolete:Prisma Client query
Before v5.1.0
5.1.0 and later
Simple
update
query, return with relation valueOne
SELECT
query could easily be dropped in a simpleupdate
query that should return a relation value as well:Prisma Client query
Before v5.1.0
5.1.0 and later
Empty
update
queryAn 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
Before v5.1.0
5.1.0 and later
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
Before v5.1.0
5.1.0 and later
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. If you didn’t find one for what you’re seeing, please create a new issue. 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 thedirectUrl
property of thedatasource
block so you can make it talk to a different database than defined inurl
. This makes it easier to use Studio alongside the Prisma Data Proxy and 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
orModelUpdate
).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
X
andXUpdate
Model
andModelUpdate
is defined in the schema@prisma/internals
(previously @prisma/sdk) uses deprecated dependencies[email protected]
viatemp-write 4.0.0
Datasource
breaks generated return typesmodel
names cause clashes in generated types$extends
TS error: "Inferred type of this node exceeds the maximum length the compiler will serialize" with"declaration": true
intsconfig
Type '"findUniqueOrThrow"' is not assignable to type 'PrismaAction'
Promise
breaks types forPrismaPromise
include
not working on models ending with...Update
with unique compound indexLogLevel
enum conflicts with built-in Prisma typePrisma.XyzFindManyArgs
breaksfindMany
typing in v4.16.0+this.$on("beforeExit")
doesn't work anymore on 5.0.0Error: Unknown value type
on nested createfindUnique
on@unique
columns that are enums<Tablename>UpsertArgs
select field does not match type fordb.<tablename>.upsert(item)
by
ingroupBy
in 5.0.0TypeError [ERR_INVALID_URL]: Invalid URL
whenHTTP(S)_PROXY
en var has is set to a URL without a protocoltsc --watch
fails withJavaScript heap out of memory
errorGetResult
Prisma Studio
directUrl
inprisma studio
Language tools (e.g. VS Code)
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.
This PR has been generated by Mend Renovate. View repository job log here.