You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Better 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 query
In a simple create query, RETURNING makes the second query and the transaction statements obsolete:
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Breaking changes1: Removal of rejectOnNotFound property
The rejectOnNotFound parameter from Prisma Client has been removed. This feature was deprecated in version 4.0.0. To adapt your application, you can replace your queries with the findFirstOrThrow or findUniqueOrThrow methods if enabled at a query-level, or use a Prisma Client extension to overload the findFirstOrThrow and findUniqueOrThrow model methods with your custom error handling if enabled at the client-level.
2: Removal of some array shortcuts
Some array shortcuts have been removed to make typings more consistent and logical. Array values are now required for the OR operator shortcuts, in and notIn operator shortcuts, PostgreSQL JSON path field shortcut, scalar list shortcuts, and MongoDB Composite types list shortcuts. You will need to update your queries to use array values for these shortcuts.
3: cockroachdb provider is now required when connecting to a CockroachDB database
It is now mandatory to use the cockroachdb provider when working with CockroachDB databases. If you were using the PostgreSQL provider, you will need to update your connector.
4: Removal of runtime/index.js from the generated Prisma Client
The runtime/index.js file has been removed from Prisma Client. If you were using APIs from this file, such as Decimal, PrismaClientKnownRequestError, NotFoundError, PrismaClientUnknownRequestError, you will need to update your imports to use Prisma.Decimal instead.
5: Removal of the beforeExit hook from the library engine
The beforeExit hook has been removed from the default library engine. You should now use the built-in Node.js exit events instead.
6: Removal of deprecated prisma2 executable
The prisma2 executable has been deprecated and will be removed. If you're using prisma2 in your scripts, replace it with prisma.
7: Removal of deprecated flags in the Prisma CLI
The following deprecated flags have been removed from the Prisma CLI: --preview-feature, --experimental, --early-access-feature, --force, --experimental-reintrospection, --clean.
8: Removal of deprecated experimentalFeatures generator property
The experimentalFeatures property in the generator property of the Prisma schema has been removed. It has been renamed to previewFeatures for a long time now. You can manually rename it to previewFeatures or use the VS Code action to rename it.
9: Renamed migration-engine to schema-engine
The migration-engine has been renamed to schema-engine. If you explicitly include or exclude the engine files, you will need to update your code references.
Breaking changes1: Prisma Client: No more type clashes
Fixed cases where using a specific term as a model name in the Prisma Schema would lead to a type clash due to Prisma's generated typings. Deprecated the Args type, and going forward, DefaultArgs should be used instead.
2: Prisma Client: Update operation includes multiple where statements for the same fields
Fixed an issue where the update operation in Prisma Client included multiple where statements for the same fields.
3: Prisma Client: wrong type when using spread operator to set default values on query args
Fixed an issue where using the spread operator to set default values on query args in Prisma Client resulted in the wrong type.
4: Prisma Client: fixing type name clashes from generated client
Fixed type name clashes in the generated client of Prisma.
5: Prisma Client: wrong nullable types with fluent API in Prisma 5.0
Fixed an issue where the nullable types were incorrect when using the fluent API in Prisma 5.0.
6: Prisma Client: Error: Unknown value type on nested create
Fixed an issue where an 'Error: Unknown value type' occurred when performing a nested create operation in Prisma Client.
7: Prisma Client: TypeScript Error TS2322 when assigning JavaScript Date object to Prisma DateTime field
Fixed a TypeScript error (TS2322) that occurred when assigning a JavaScript Date object to a Prisma DateTime field.
8: Prisma Client: Types wrongly accept non-array parameter by in groupBy in 5.0.0
Fixed an issue where the types in Prisma Client wrongly accepted a non-array parameter 'by' in the groupBy function in version 5.0.0.
9: Prisma CLI errors with TypeError [ERR_INVALID_URL]: Invalid URL when HTTP(S)_PROXY env var is set to a URL without a protocol
Fixed an issue where the Prisma CLI threw a TypeError [ERR_INVALID_URL]: Invalid URL when the HTTP(S)_PROXY environment variable was set to a URL without a protocol.
10: Prisma CLI fails with JavaScript heap out of memory error when running tsc --watch
Fixed an issue where the Prisma CLI failed with a JavaScript heap out of memory error when running tsc --watch.
11: Prisma Studio: Use directUrl in prisma studio
Prisma Studio now supports the directUrl property of the datasource block, allowing it to talk to a different database than defined in url.
Breaking changes1: Removal of rejectOnNotFound property
The rejectOnNotFound parameter was removed from Prisma Client. It was deprecated in version 4.0.0. To adapt your application, you can replace your queries with the findFirstOrThrow or findUniqueOrThrow methods if enabled at a query-level, or use a Prisma Client extension to overload the findFirstOrThrow and findUniqueOrThrow model methods with your custom error handling if enabled at the client-level.
2: Removal of some array shortcuts
Some array shortcuts were removed to make typings more consistent and logical. Array values are now required for the OR operator shortcuts, in and notIn operator shortcuts, PostgreSQL JSON path field shortcut, scalar list shortcuts, and MongoDB Composite types list shortcuts. You will need to update your queries to use array values for these shortcuts.
3: cockroachdb provider is now required when connecting to a CockroachDB database
Previously, it was possible to use the PostgreSQL provider when working with CockroachDB databases. Now, it is mandatory to use the CockroachDB connector when working with CockroachDB databases. If you were using the PostgreSQL connector, you will need to update your connector.
4: Removal of runtime/index.js from the generated Prisma Client
The runtime/index.js file was removed from Prisma Client. If you were using APIs from runtime/index.js, such as Decimal, PrismaClientKnownRequestError, NotFoundError, PrismaClientUnknownRequestError, you will need to update your imports to use Prisma.Decimal instead of Decimal.
5: Removal of the beforeExit hook from the library engine
The beforeExit hook was removed from the default library engine. You should use the built-in Node.js exit events instead.
6: Removal of deprecated prisma2 executable
The prisma2 executable has been deprecated and will be removed. If you're using prisma2 in your scripts, replace it with prisma.
7: Removal of deprecated flags in the Prisma CLI
The following deprecated flags were removed from the Prisma CLI: --preview-feature, --experimental, --early-access-feature, --force, --experimental-reintrospection, --clean. If you were using any of these flags, remove them from your commands.
8: Removal of deprecated experimentalFeatures generator property
The experimentalFeatures property in the generator property of the Prisma schema was removed. It has been renamed to previewFeatures. If you're still using the experimentalFeatures property, either manually rename it to previewFeatures or use the VS Code action to rename it.
9: Renamed migration-engine to schema-engine
The migration-engine was renamed to schema-engine. If you explicitly include or exclude the engine files, you will need to update your code references.
Breaking changes1: Prisma Client: No more type clashes
Fixed cases where using a specific term as a model name in the Prisma Schema would lead to a type clash. Deprecated the Args type, and DefaultArgs should be used instead.
2: Prisma Client: wrong type when using spread operator to set default values on query args
Fixed an issue where using the spread operator to set default values on query args would result in the wrong type.
3: Prisma Client: fixing type name clashes from generated client
Fixed type name clashes that occurred in the generated Prisma Client.
Fixed an issue where there was a duplicate identifier 'CheckSelect'.
14: Prisma Client: naming a model Datasource breaks generated return types
Fixed an issue where naming a model Datasource broke generated return types.
15: Prisma Client: Certain model names cause clashes in generated types
Fixed an issue where certain model names caused clashes in generated types.
16: Prisma Client: Type error on query with select field (although query runs successfully)
Fixed a type error that occurred on a query with a select field, even though the query ran successfully.
17: Prisma Client: $extends TS error: "Inferred type of this node exceeds the maximum length the compiler will serialize" with "declaration": true in tsconfig
Fixed a TypeScript error that occurred when using $extends with "declaration": true in tsconfig.
18: Prisma Client: Type conflict when naming a table {something} and a second table {something}Result
Fixed a type conflict that occurred when naming a table {something} and a second table {something}Result.
19: Prisma Client: Naming a model Promise breaks types for PrismaPromise
Fixed an issue where naming a model Promise broke types for PrismaPromise.
20: Prisma can't connect with an IPv6 host (on e.g. Fly.io)
Fixed an issue where Prisma couldn't connect with an IPv6 host.
21: Prisma Client: include not working on models ending with ...Update with unique compound index
Fixed an issue where include was not working on models ending with ...Update with a unique compound index.
22: Prisma Client: Update operation includes multiple where statements for the same fields
Fixed an issue where the update operation included multiple where statements for the same fields.
23: Prisma Client: Type conflict when naming a table {something} and a second table {something}Result
Fixed a type conflict that occurred when naming a table {something} and a second table {something}Result.
24: Prisma Client: UpsertArgs select field does not match type for db..upsert(item)
Fixed an issue where the select field in UpsertArgs did not match the type for db..upsert(item).
25: Prisma Client: TypeScript Error TS2322 when assigning JavaScript Date object to Prisma DateTime field
Fixed a TypeScript error that occurred when assigning a JavaScript Date object to a Prisma DateTime field.
26: Prisma Client: npm install of Prisma CLI fails on preinstall with no logs when Node.js version is lower than minimum
Fixed an issue where npm install of Prisma CLI failed on preinstall with no logs when the Node.js version was lower than the minimum.
27: Prisma Client: Types wrongly accept non-array parameter by in groupBy in 5.0.0
Fixed an issue where types wrongly accepted a non-array parameter by in groupBy in version 5.0.0.
28: Prisma Client: CLI errors with TypeError [ERR_INVALID_URL]: Invalid URL when HTTP(S)_PROXY en var has is set to a URL without a protocol
Fixed an issue where the CLI errors with TypeError [ERR_INVALID_URL]: Invalid URL when the HTTP(S)_PROXY en var is set to a URL without a protocol.
29: Prisma Client: tsc --watch fails with JavaScript heap out of memory error
Fixed an issue where tsc --watch failed with a JavaScript heap out of memory error.
30: Prisma Client: Hovering over types (intellisense) shows confusing GetResult
Fixed an issue where hovering over types (intellisense) showed confusing GetResult.
31: Prisma Client: Internal query batching fails when the table name is 'stores'
Fixed an issue where internal query batching failed when the table name was 'stores'.
32: Prisma Client: Client extensions result extensions should be applied after query extensions
Fixed an issue where client extensions result extensions were not applied after query extensions.
33: Prisma Studio: Use directUrl in prisma studio
Prisma Studio now supports the directUrl property of the datasource block.
34: Language tools (e.g. VS Code): The extension for VS Code ignores the modern telemetry flag
Fixed an issue where the extension for VS Code ignored the modern telemetry flag.
35: Language tools (e.g. VS Code): Prisma VS Code extension with mongodb provider crashes when a relation field/type is not defined
Fixed an issue where the Prisma VS Code extension with the MongoDB provider crashed when a relation field/type was not defined.
36: Language tools (e.g. VS Code): Editing schema.prisma results in wasm panics
Fixed an issue where editing schema.prisma resulted in wasm panics.
Breaking changes1: Removal of rejectOnNotFound property
The rejectOnNotFound parameter from Prisma Client has been removed. This feature was deprecated in version 4.0.0. To adapt your application, you can replace your queries with the findFirstOrThrow or findUniqueOrThrow methods if enabled at a query-level, or use a Prisma Client extension to overload the findFirstOrThrow and findUniqueOrThrow model methods with your custom error handling if enabled at the client-level.
2: Removal of some array shortcuts
Some array shortcuts have been removed to make typings more consistent and logical. Array values are now required for the OR operator shortcuts, in and notIn operator shortcuts, PostgreSQL JSON path field shortcut, scalar list shortcuts, and MongoDB Composite types list shortcuts. You will need to update your queries to use array values for these shortcuts.
3: cockroachdb provider is now required when connecting to a CockroachDB database
It is now mandatory to use the cockroachdb provider when working with CockroachDB databases. If you were using the PostgreSQL provider, you will need to update your connector.
4: Removal of runtime/index.js from the generated Prisma Client
The runtime/index.js file has been removed from Prisma Client. If you were using APIs from runtime/index.js, such as Decimal, PrismaClientKnownRequestError, NotFoundError, PrismaClientUnknownRequestError, you will need to update your imports to use Prisma.Decimal instead.
5: Removal of the beforeExit hook from the library engine
The beforeExit hook has been removed from the default library engine. You should now use the built-in Node.js exit events instead.
6: Removal of deprecated prisma2 executable
The prisma2 executable has been deprecated and will be removed. If you're using prisma2 in your scripts, replace it with prisma.
7: Removal of deprecated flags in the Prisma CLI
The following deprecated flags have been removed from the Prisma CLI: --preview-feature, --experimental, --early-access-feature, --force, --experimental-reintrospection, --clean.
8: Removal of deprecated experimentalFeatures generator property
The experimentalFeatures property in the generator property of the Prisma schema has been removed. It has been renamed to previewFeatures for a long time now. You can manually rename it to previewFeatures or use the VS Code action to rename it.
9: Renamed migration-engine to schema-engine
The migration-engine has been renamed to schema-engine. If you explicitly include or exclude the engine files, you will need to update your code references.
Breaking changes1: Prisma Client: No more type clashes
Fixed 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. The <ModelName>Args type has been deprecated. Going forward, <ModelName>DefaultArgs should be used instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependenciesPull requests that update a dependency file
0 participants
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.
Bumps @prisma/client from 4.16.1 to 5.1.1.
Release notes
Sourced from
@prisma/client's releases.... (truncated)
Commits
78de340chore(deps): patch 5.1.x 5.1.1-1.6a3747c37ff169c90047725a05a6ef02e32ac97e (#2...8048715fix(client): Make sure result extensions don't break.count(#20504)a045943fix(client): Fix $Enums namespace in browser build (#20481)0eb32dcfeat(client): allow extension to reference their $parent (#20425)22011adchore(deps): update engines to 5.1.0-28.a9b7003df90aa623086e4d6f4e43c72468e63...47b3ce6fix(client): add extra schema search location (#20447)8e02861chore(deps): update dependency@swc/jestto v0.2.27 (#20389)551db6cfix(client): confusing get result types (#20435)b7ed20dfix(client): enum types (#20446)b15ac85fix(client): Ensure result extensions are applied after all query extensions ...Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)