Update prisma monorepo to v4.16.2 (main) #9
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.6.1
->4.16.2
4.6.1
->4.16.2
Release Notes
prisma/prisma (@prisma/client)
v4.16.2
Compare Source
Today, we are issuing the
4.16.2
patch release.Fixes in Prisma Client
$allModels: { $allOperations }
sets query type tonever
undefined
explicitly passed toselect
/include
v4.16.1
Compare Source
Today, we are issuing the
4.16.1
patch release.Fixes in Prisma Client
$extend
in factory function whencompilerOptions.composite
istrue
v4.16.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
This release promotes the following Preview features to General Availability:
Prisma Client extensions are Generally Available
Today, we’re very excited to announce that Prisma Client extensions are Generally Available and production-ready! This means you can use the feature without the
clientExtensions
Preview feature flag.🚀Prisma Client extensions are a powerful new feature for adding functionality on top of your Prisma Client in a type-safe manner. With this feature, you can create simple, but flexible solutions.
Prisma Client extensions have 4 different types of components that can be included in an extension:
findMany
.You can also create and publish extensions for others to use. Learn more about how to share extensions in our documentation.
More features and changes made to Client Extensions
We also made the following improvements to Prisma Client extensions in preparation for General Availability:
Added a top-level
$allOperations
method forquery
component that captures all model operations as well as top-level raw queries. Refer to our documentation for more information.Prisma.validator
can now also be used for extended types:query
callbacks for$queryRaw
and$executeRaw
will always receiveSql
instance asargs
. This instance can be used to compose a new query usingPrisma.sql
:$on
cannot be called after extending Prisma Client. Therefore, if you want to use event handlers together with extensions, we recommend using the$on
method before$extends
.We updated the import path for utilities used for authoring extension to
@prisma/client/extension
rather than@prisma/client
Deprecating Middleware
We also took this opportunity to deprecate Prisma Client’s middleware. We recommend using to using Prisma Client
query
extension components which can be used to achieve the same functionality and with better type safety.Ordering by nulls first and last is now Generally Available
Starting with this release, we’re excited to announce that
orderByNulls
is now Generally Available! This means you can use the feature without theorderByNulls
Preview feature flag.🌟We introduced this feature in 4.1.0 to enable you to sort records with null fields to either appear at the beginning or end of the result.
The following example query sorts posts by
updatedAt
, with records having a null value at the end of the list:To learn more about this feature, refer to our documentation.
We’re excited to see what you will build! Feel free to share with us what you build on Twitter, Slack, or Discord.
Count by filtered relation is now Generally Available
This release moves the
filteredRelationCount
Preview feature to General Availability! This means you can use the feature without thefilteredRelationCount
Preview feature flag.We first introduced this feature in 4.3.0 to add the ability to count by filtered relations.
The following query, for example, counts all posts with the title “Hello!”:
To learn more about this feature, refer to our documentation.
Introspection warnings for expression indexes
In the last two releases, 4.13.0 and 4.14.0, we added 9 introspection warnings. These warnings surface features in use in your database that cannot currently be represented in the Prisma schema.
In this release, we’re adding one more introspection warning to the list: expression indexes.
On database introspection, the Prisma CLI will surface the feature with a warning, and a comment in your Prisma schema for sections for each feature in use. The warnings will also contain instructions for workarounds on how to use the feature.
Fixes and improvements
Prisma Client
select
'd explicitly.prisma generate
when running it directly after installingprisma
$runCommandRaw
is not passing the expected data to middleware or client extension.prismaVersion.client
available on "@prisma/client/scripts/default-index"distinct
fieldPrisma.validator
clientExtensions
GA$queryRawUnsafe
also triggers$allModels.$allOperations
$on
applied to an extended client is also bound to the parent client$queryRaw*
is broken in interactive transactions together withclientExtensions
in4.16.0-dev.17
Prisma Migrate
type
sprisma db pull
gets rid of@default(uuid())
on re-introspectionLanguage tools (e.g. VS Code)
Go to Definition
does not work when target model contains a field with a type name that starts with the same namePrisma Studio
Error: spawn xdg-open ENOENT
onprisma studio
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, June 22 at 5 pm Berlin | 8 am San Francisco.
v4.15.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
For this release, we focused on fixing bugs and making smaller quality-of-life improvements.
Support for custom arguments for
prisma db seed
This release adds support for defining and passing arbitrary arguments to
prisma db seed
. This creates the opportunity for you to define your own arguments in your seed file that you could pass to theprisma db seed
command. A few example use-cases include, but are not limited to:Here is an example
seed.ts
file that defines custom arguments for seeding different data in different environments:You can then provide the
environment
argument when executing the seed script as follows:Let us know what you think, share example usage of this feature, and create a bug report if you run into any issues.
Improved error messages when Query Engine file is not found
This release improves the error messages returned by Prisma Client when the Query Engine file is not found. A few reasons the Query Engine file might be missing from your application bundle include when:
We hope these error messages are helpful while debugging your application.
Prisma VS Code extension improvements
In this release, we made a few improvements to our VS Code extension:
Updated the file system watcher that is responsible for restarting the TypeScript server when
prisma generate
is run to ensure the types are in syncAdded Quick Fixes action for unique identifiers for MongoDB to add the
@map("_id")
attribute function when it’s missing on an identifier fieldScreen.Recording.2023-05-17.at.19.22.20.mov
Support for renaming symbols for composite types and views
type-symbol-rename.mov
Fixes and improvements
Prisma Client
Error: write EPIPE
on WSL <-> Windowsprisma generate
is blocked byquery-engine-rhel-openssl-1.0.x
opening in Notepad on Windowsnode_modules
(from another platform) leads to platform engine not being presentoutput
Query engine library for current platform "rhel-openssl-1.0.x" could not be found. You incorrectly pinned it to rhel-openssl-1.0.x
Cannot find name '$PrismaModel'
due to featureextendedWhereUnique
with preview featurefieldReference
Date
values silently turn intonulls
fieldReference
is not working with enumsPrisma Migrate
prisma db seed
to the seed commandLanguage tools (e.g. VS Code)
@map("_id")
annotationCredits
Huge thanks to @RobertCraigie, @KhooHaoYit, @art049, @luxaritas, @mrazauskas, @maxmartynov, @haneenmahd for helping!
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, June 1 at 5 pm Berlin | 8 am San Francisco.
v4.14.1
Compare Source
Today, we are issuing the
4.14.1
patch release.Fix in Prisma Client
v4.14.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Request for feedback for Preview features
We would appreciate your feedback on a handful of Preview features to help us move them to General Availability soon. The Preview features include:
You can test them by enabling the Preview feature in your Prisma schema and giving them a try already in your Prisma schema, e.g., PostgreSQL extensions, or regenerating Prisma Client and trying them in your queries.
Highlights
Improved Prisma Client startup performance
For the last couple of months, we've been working hard to improve the performance of Prisma Client. We also published a blog post on how How We Sped Up Serverless Cold Starts with Prisma by 9x, which we recommend you give it a read.
This release continues with the same theme by making the size of the generated Prisma Client smaller. We have roughly halved the size of Prisma Client's dependencies.
More Introspection warnings for unsupported features
In 4.13.0, we introduced the first 6 introspection warnings that surface the existence of these features in your database and link to our documentation on how to manually work around the Prisma Schema with unsupported database features.
In this release, we added 3 more introspection warnings for the following features:
On introspecting a database using any of these features, you will get a warning from the Prisma CLI and a comment in your Prisma schema where the feature is being used. The warning will also contain a link to instructions on how to manually use the feature.
Fixes and improvements
Prisma Client
client
leads toError: ENOENT: no such file or directory, open '.../node_modules/@​prisma/client/schema.prisma'
thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: No unsupported field should reach that path', query-engine\connectors\sql-query-connector\src\model_extensions\scalar_field.rs:70:44
in
argument of filter types does not accept scalarsjsonProtocol
should report errors as nicely as beforeclient
:ENOENT: no such file or directory, open 'D:\<projectpath>\node_modules\.prisma\client\schema.prisma
Prisma Migrate
Please create an issue ...
inMigrateEngine.ts
DbPull.ts
to the engineviews
folder on introspection if no views are foundLanguage tools (e.g. VS Code)
Credits
Huge thanks to @RobertCraigie, @KhooHaoYit, @art049, @luxaritas, @mrazauskas for helping!
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, May 11 at 5 pm Berlin | 8 am San Francisco.
v4.13.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Introspection warnings for unsupported features
The Prisma Schema Language (PSL) currently doesn't support all database features and functionality of our target databases. The PSL is an abstraction over SQL and will keep evolving to address gaps in our database feature matrix.
Before this release,
prisma db pull
did not pick up the unsupported features in a database. It was easy to lose them when runningprisma migrate dev
based on an existing Prisma schema if not included in a migration file using custom migrations.To avoid this, we added introspection warnings that surface the existence of these features in your database and link to our documentation on how to manually work around the Prisma Schema with unsupported database features.
In this release, we added introspection warnings for the following features:
NULLS FIRST
/NULLS LAST
Prisma CLI will output warnings on introspection (
prisma db pull
) and add comments to your Prisma schema. In the coming releases, we will expand this to many more features labeled withtopic: database-functionality
on GitHub.Improved support for Netlify and Vercel build process
Netlify and Vercel cache project dependencies during the build process and reuse that cache until dependencies change. While this helps speed up the build process, any
postinstall
scripts of these dependencies will not be executed.Prisma uses a
postinstall
script in its package to automatically trigger the customized generation of Prisma Client for your Prisma Schema. When a dependency cache is used, that generation process is not triggered, and an outdated Prisma Client may be used in your application.When you update your Prisma Schema but not your dependencies, Prisma Client will not be generated for the new schema. For example, columns you added recently to one of your models will not be present in the Prisma Client API - causing errors.
This problem can be avoided by:
postinstall
script in yourpackage.json
fileprisma generate
step to the “Build” scripts of Vercel and Netlify.We now added detection of this scenario and will prevent a build without an additional
prisma generate
. This will ensure you're aware of the problem early and get guidance on how to fix this problem. You can read more on how to do this in our docs — Vercel caching troubleshooting, Netlify caching troubleshooting.Better support for pnpm as a package manager
Before this release, Prisma only used npm scripts which would lead to undesirable behavior for a project using a different package manager such as pnpm and yarn. This release improves the detection of the package managers in your project by using
ni
. If you're still running into this problem, let us know by creating a GitHub issue.Segmentation fault and TLS connection error fix
In this release, we've fixed a TLS connection error segmentation fault. This mostly affected users running on Node.js 17 or later with OpenSSL 1.1 when using TLS to connect to their database.
JSON protocol Preview feature feedback
We have fixed multiple bugs for the
jsonProtocol
Preview feature and are close to making it Generally Available. We are still looking for feedback about its usage to ensure it is ready and works as expected for everyone.We would appreciate it if you would try it out, help us polish the feature, and move it to General Availability. Testing it requires little effort. You can test it using the following steps:
jsonProtocol
Preview feature in your Prisma schemaWe encourage you to leave your feedback in this GitHub issue or create a bug report if your run into any issues.
Fixes and improvements
Prisma Client
prisma generate
fails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarnnode_modules
cache that contains generated Clientprisma generate
when@prisma/client
is not installed in projectpnpm install
hangs on@prisma/client
postinstallPrisma Migrate
Language tools (e.g. VS Code)
[object Object]
output in logging isn't helpfulCredits
Huge thanks to @KhooHaoYit, @rintaun, @maxmartynov, @haneenmahd for helping!
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, April 20 at 5 pm Berlin | 8 am San Francisco.
v4.12.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Introspection of Views SQL improvements (Preview)
The
views
Preview feature significantly improved this release:prisma db pull
now reads the SQL query used to define a view and stores it in a.sql
file in aviews
folder next to your Prisma schema.We encourage you to leave feedback in this GitHub issue.
Improvements to JSON protocol (Early Preview)
In 4.11.0, we announced the
jsonProtocol
Preview feature which had some rough edges. This release improves the Preview feature by providing polished and helpful error messages from Prisma Client when something goes wrong. Here is an example error message:We would appreciate it if you would try it out to help us polish the feature and move it to General Availability. Testing it requires little effort. Please also leave any feedback in this issue, or open a new one if you want to report a bug.
Prisma Client startup performance
In this release, we've improved the startup performance of Prisma Client. We're keen on improving the performance of Prisma Client. If you experience any problems with the startup performance, be sure to report them so that we can look into them.
Open Telemetry tracing and logging for Prisma Client for Data Proxy
This release adds support for Open Telemetry tracing (via the
tracing
Preview feature) and logging to Prisma Client for Data Proxy.Fixes and improvements
Prisma Migrate
db pull
fail with particular enum default value in columnPrisma Client
findUnique
used withPromise.all
returnsnull
PrismaPromise
export after update from 4.9.0 to 4.11.0Unique constraint failed on the fields
on query that worked in 4.10.1jsonProtocol
Field/Enum is not included in the result of the findFirst/findMany functionLanguage tools (e.g. VS Code)
type
block for MongoDBCredits
Huge thanks to @KhooHaoYit, @rintaun, @ivan, @art049 for helping!
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, March 30 at 5 pm Berlin | 8 am San Francisco.
v4.11.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
JSON protocol Early Preview
This release introduces an early Preview feature: JSON protocol.
During performance investigations and optimizations, we noticed that the existing implementation added a CPU and memory overhead that was especially noticeable for larger Prisma schemas. Therefore, we found an alternative way to express our queries without needing that overhead: JSON.
To try out the new protocol, enable the
jsonProtocol
Preview feature in your Prisma schema:Regenerate Prisma Client to use the new JSON protocol.
For environments or situations where it is not viable to enable the Preview feature flag to your Prisma schema file, we also added an environment variable that you can use to force the use of the JSON Protocol Preview feature:
PRISMA_ENGINE_PROTOCOL=json
.Note: This is an early Preview feature with a significant limitation: Invalid input to Prisma Client will throw unpolished, internal errors that are less descriptive and user-friendly than our usual ones. We intend to improve these future releases. Using it with Data Proxy and Prisma Data Platform currently also leads to errors.
We expect using
jsonProtocol
to improve Prisma Client's startup performance significantly. This will likely have a more significant impact on applications with larger Prisma schemas.We would appreciate your feedback on this feature on the following particularly:
For feedback, please comment on the GitHub feedback issue.
Introspection support for MySQL, SQL Server, and CockroachDB views
You can now run
prisma db pull
against your database to populate your Prisma schema with your views in MySQL, SQL Server, and CockroachDB.To learn more, refer to our documentation on views introspection. Try it out and let us know your thoughts in this GitHub issue.
Prisma Client extensions improvements: raw query operations
This release adds support for extending top-level raw query operations.
Webpack plugin for Next.js apps using Prisma in monorepo setups
If you've been using Prisma Client in a Next.js app in a monorepo setup, you might have seen this infamous error message:
We finally pinpointed the problem's source to the Next.js bundling step and opened an issue in the Next.js repository for Vercel to investigate and hopefully fix it.
In the meantime, we've created a workaround via a webpack plugin that makes sure your Prisma schema is copied to the correct location:
@prisma/nextjs-monorepo-workaround-plugin
.To use the plugin, first install it:
Import the plugin into your
next.config.js
file and use it inconfig.plugins
:For further information, refer to our documentation to learn how to use it and open an issue if it doesn't work as expected.
Fixes and improvements
Prisma Client
ENOENT: no such file or directory, open '...\.next\server\pages\api\schema.prisma'
Error: ENOENT: no such file or directory, open 'schema.prisma'
ENOENT
with custom output and ESM module in NPM monorepo (including Nextjs):no such file or directory, open /.../schema.prisma...
ignoreEnvVarErrors: true
Node API QE causesdatasourceOverrides
to be ignoredPrisma Migrate
db pull
: add new codes for introspection warnings for views in the CLIdirectUrl
isprisma://
connection stringerrorCode: 'P1012' PrismaClientInitializationError: error: Environment variable not found: DATABASE_URL.
directUrl
env var value, leading to validation error (Affects PDP/Data Proxy and normal Engine)validate
to returnResult<(), JsError>
inWasm
moduleCredits
Huge thanks to @KhooHaoYit, @rintaun, @ivan, @Mini256, @Lioness100, @yukukotani, @sandrewTx08, @fubhy, @zachtil, @unflxw, @Mosaab-Emam for helping!
📺 Join us for another "What's new in Prisma" live stream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.
The stream takes place on YouTube on Thursday, March 2 at 5 pm Berlin | 8 am San Francisco.
v4.10.1
Compare Source
Today, we are issuing the
4.10.1
patch release.Fixes in Prisma Client
v4.10.0
Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Improved CLI support for connection poolers
When working with connection poolers such as the Prisma Data Proxy, Accelerate or [pgBouncer](https://www.prisma.io/docs/guides/performance-a
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.