New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(deps): update dependency @prisma/client to v3 #732
Merged
Conversation
This file contains 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
⏱ Benchmark resultsComparing with fb06c4b largeDepsEsbuild: 13.8s⬆️ 21.36% increase vs. fb06c4b
Legend
largeDepsZisi: 1m 15.8s⬆️ 19.99% increase vs. fb06c4b
Legend
|
renovate
bot
force-pushed
the
renovate/major-prisma-monorepo
branch
7 times, most recently
from
October 11, 2021 08:11
bbc8568
to
d358777
Compare
renovate
bot
force-pushed
the
renovate/major-prisma-monorepo
branch
from
October 11, 2021 08:20
d358777
to
19d75df
Compare
prisma moving to semantic versioning! yay! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
^2.9.0
->^3.0.0
Release Notes
prisma/prisma
v3.2.1
Compare Source
Today, we are issuing the
3.2.1
patch release.Fixes
Prisma Client
#9624
v3.2.0
Compare Source
Today, we are excited to share the
3.2.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
MongoDB introspection support is now in Preview 🚀
In this version, we introduce support for introspecting MongoDB databases. If adding Prisma to an existing project, running
prisma db pull
against a MongoDB database with existing data will sample the data and create a Prisma data model based on the stored documents.This comes with a few caveats:
mongoDb
must be enabled on thedatasource
block in the Prisma schema.prisma db pull
multiple times will overwrite any manual changes to the data model for now.We're constantly iterating on this feature, so please provide feedback for introspecting MongoDB databases!
Get the count of a relation in MongoDB
This release, we're giving MongoDB developers the ability to query the count of a relation. In the example below, we're getting the number of posts each user wrote:
This feature was previously available for SQL databases and now it's also available in MongoDB. Learn more in our documentation.
Fixes and improvements
Prisma Migrate
prisma db -h
still mentionsseed
as a preview featurePrisma Client
prisma init
Prisma
selectRelationCount
(since 2.20.0)Prisma Studio
prisma
patch releases.Credits
Huge thanks to @otan, @cbuchacher for helping out in this release!
CTA
📺 Join us for another "What's new in Prisma" livestream
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.
The stream takes place on Youtube on Thursday, October 07 at 5pm Berlin | 8am San Francisco.
v3.1.1
Today, we are excited to share the
3.1.1
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release.
Major improvements
Referential Integrity is in Preview 🚀
Relational databases typically ensure integrity between relations with foreign key constraints, for example, given a 1:n relation between
User:Post
, you can configure the deletion of a user to cascade to posts so that no posts are left pointing to a User that doesn't exist. In Prisma, these constraints are defined in the Prisma schema with the@relation()
attribute.However, databases like PlanetScale do not support defining foreign keys. To work around this limitation so that you can use Prisma with PlanetScale, we're introducing a new
referentialIntegrity
setting in Preview.This was initially introduced in version
2.24.0
of Prisma with theplanetScaleMode
preview feature and setting. Starting with this release both have been renamed toreferentialIntegrity
.The setting lets you control whether referential integrity is enforced by the database with foreign keys (default), or by Prisma, by setting
referentialIntegrity = "prisma"
.Setting Referential Integrity to
prisma
has the following implications:You can give it a try in version 3.1.1 by enabling the
referentialIntegrity
preview flag:After changing
referentialIntegrity
toprisma
, make sure you runprisma generate
to ensure that the Prisma Client logic has been updated.Note that Referential Integrity is set to
prisma
by default when using MongoDB.Learn more about it in our documentation, and share your feedback.
Full-Text Search for the Go Client
In an earlier release, we added Full-Text Search (for PostgreSQL) to the Typescript Client. This was released as a Preview feature.
In this release, we've added that Preview feature to the Go Client. Enable it in your Go project by adding the
fullTextSearch
preview feature.Here's an example:
You can get started with the Go Client using our Quick Start Guide. Learn more about Full-Text Search in our documentation.
Interested in Prisma’s upcoming Data Proxy for serverless backends? Get notified! 👀
Database connection management in serverless backends is challenging: taming the number of database connections, additional query latencies for setting up connections, etc.
At Prisma, we are working on a Prisma Data Proxy that makes integrating traditional relational and NoSQL databases in serverless Prisma-backed applications a breeze. If you are interested, you can sign up to get notified of our upcoming Early Access Program here:
https://pris.ly/prisma-data-proxy
📺 Join us for another "What's new in Prisma" livestream
Learn about the latest 3.1.1 release and other news from the Prisma community by joining Daniel Norman from the Prisma team for another What's new in Prisma livestream.
The stream takes place on Youtube on Thursday, September 23 at 5pm Berlin | 8am San Francisco.
Fixes and improvements
Prisma Migrate
planetScaleMode = true
is not preserved duringdb pull
Prisma Client
Option::unwrap()
on aNone
valuenApi
preview feature is still allowed and suggestedPrisma
prisma 3.0.1
warns about breaking changes.onUpdate
with prisma level integrityCredits
Huge thanks to @saintmalik, @benkenawell, @ShubhankarKG, @hehex9 for helping!
v3.0.2
Compare Source
Today, we are issuing the
3.0.2
patch release.Fixes
Prisma CLI
v3.0.1
Compare Source
Today, we are excited to share the
3.0.1
stable release 🎉As previously announced, Prisma has adopted SemVer strictly and this is the first major release which means it has some breaking changes.
For all the breaking changes, there are guides and documentation to assist you with the upgrade.
This release promotes many Preview features to General Availability. This means that they are ready for production use and have passed rigorous testing both internally and by the community.
We recommend that you read through the breaking changes below carefully and make sure that you've correctly upgraded your application.
🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release.
Major improvements
Today's release is packed with many new features that are now Generally Available!
Here's a summary:
prisma db seed
has been revampedRead along to dive deeper into all the new Generally Available improvements.
To read more about what Generally Available means, check out the maturity levels in the Prisma docs.
Referential Actions is now Generally Available
Referential Actions is a feature that allows you to control how relations are handled when an entity with relations is changed or deleted. Typically this is done when defining the database schema using SQL.
Referential Actions allows you to define this behavior from the Prisma schema by passing in the
onDelete
andonUpdate
arguments to the@relation
attribute.For example:
Here, you would not be able to delete a
LitterBox
as long as there still is aCat
linked to it in your database, because of theonDelete: Restrict
annotation. If we had writtenonDelete: Cascade
, deleting aLitterBox
would also automatically delete theCat
s linked to it.Referential Actions was first released in in 2.26.0 with the
referentialActions
Preview flag. Since then, we've worked to stabilize the feature.Today, we're delighted to announce that Referential Actions is now General Available, meaning it is enabled by default. 🐱
On PostgreSQL, MySQL, SQLite and Microsoft SQL Server, referential actions will be enforced by the database.
If you use Prisma Migrate to manage your database schema, you can use introspection with
prisma db pull
to automatically fill in the existing referential actions from your database. Please read the upgrade guide for all the details.🚨 Please note that the defaults change in this release. In some cases, this can lead to queries behaving differently in Prisma 3.x compared to Prisma 2.x, since the database will be enforcing referential actions, and not Prisma Client anymore. This means that if you only update your client without changing your Prisma schema, you will lose Prisma-level protections against cascading deletes. Read more in the Breaking Changes section below and the upgrade guide for a detailed explanation and steps to follow. 🚨
Named Constraints is now Generally Available
One of the core concepts in Prisma is the Prisma schema which serves as a single source of truth for your database schema and application models. For Prisma to automatically generate migrations and Prisma Client, it's necessary for the Prisma schema to represent the database schema as accurately as possible.
Named Constraints allows the Prisma schema to more accurately represent the names of all currently supported constraints such as unique constraints, primary keys, etc.
By having this representation in the Prisma schema, you now have finer control over two things:
prisma db push
command.findUnique
queries on compound indices.Named Constraints was initially released in Preview in 2.29.0. Since then, we've made minor fixes and improvements to ease the upgrade experience.
Today, we're happy to launch Named Constraints to General Availability, meaning it will be enabled by default.
Named Constraints are about reflecting another aspect of the database in your Prisma schema: many objects in your schema, like indexes, unique constraints, and foreign keys, have a name in the database. That was not properly reflected in the Prisma Schema Language in earlier versions. The addition of Named Constraints fills this gap and improves overall correctness.
Given the following example:
You can see that
@id
,@relation
and@@​unique
now can take amap
argument corresponding to the database name of the primary key/foreign key/constraint.@@​unique
can also take aname
argument to control the naming of theWhereUnique
argument in Prisma Client.A quick way to remember: The new API is uniform.
map: "..."
always corresponds to a name in the database, whereasname: "..."
always corresponds to names in the Prisma Client API.🚨 Please note that you will have to make conscious decisions about constraint names when you upgrade to Prisma 3. Prisma will help you with the upgrade process using introspection with
prisma db pull
and Prisma Migrate. Read more in the Breaking Changes section below and the upgrade guide for a detailed explanation and steps to follow. 🚨Microsoft SQL Server and Azure SQL Connector is now Generally Available
Today we are excited to announce that Prisma support for Microsoft SQL Server and Azure SQL is Generally Available and ready for production!
Since we released Prisma Client for General Availability over a year ago with support for PostgreSQL, MySQL, SQLite, and MariaDB, we've heard from thousands of engineers about how the Prisma ORM is helping them be more productive and confident when building data-intensive applications.
After passing rigorous testing internally and by the community over the last year since the Preview release in version 2.10.0, we are thrilled to bring Prisma's streamlined developer experience and type safety to developers using Microsoft SQL Server and Azure SQL in General Availability 🚀.
Learn more in the release blog post 🤓
Seeding with
prisma db seed
has been revamped and is now Generally AvailableWhen developing locally, it's common to seed your database with initial data to test functionality. In version 2.15 of Prisma, we initially introduced a Preview version of seeding using the
prisma db seed
command.Today, we're excited to share that the
prisma db seed
command has been revamped and simplified with a better developer experience and is now Generally Available.The seeding functionality is now just a hook for any command defined in
"prisma"."seed"
in yourpackage.json
.For example, here's how you would define a TypeScript seed script with
ts-node
:package.json
of your projectExpand to view an example seed script
This approach gives you more flexibility and makes fewer assumptions about how you choose to seed. You can define a seed script in any language as long as you it's just a terminal command.
For example, here's how you would seed using an SQL script and the
psql
CLI tool.🚨 Please note that if you already have a seed script that worked created in versions prior, you will need to add the script to
prisma.seed
in yourpackage.json
and adapt the script to the new API. Read more in the Breaking Changes section below and the seeding docs for a complete explanation and walkthroughs of common use cases.Node-API is Generally Available
Node-API is a new technique for binding Prisma's Rust-based query engine directly to Prisma Client. This reduces the communication overhead between the Node.js and Rust layers when resolving Prisma Client's database queries.
Earlier versions of Prisma (since version 2.0.0) used the Prisma Query Engine binary, which runs as a sidecar process alongside your application and handles the heavy lifting of executing queries from Prisma Client against your database.
In 2.20.0 we introduced a Preview feature, the Node-API library, as a more efficient way to communicate with the Prisma Engine binary. Using the Node-API library is functionally identical to running the Prisma engine binary while reducing the runtime overhead by making direct binary calls from Node.js.
Starting with today's 3.0.1 release we are making the Node-API library engine the default query engine type. If necessary for your project, you can fall back to the previous behavior of a sidecar Prisma Engine binary, however, we don't anticipate a reason to do so.
If you've been using this preview feature, you can remove the
nApi
flag frompreviewFeatures
in your Prisma Schema.Learn more about the Query Engine in our documentation.
Order by Aggregate in Group By is Generally Available
Let's say you want to group your users by the city they live in and then order the results by the cities with the most users. Order by Aggregate Group allows you to do that, for example:
Expand to view the underlying Prisma schema
Order by Aggregate Group was initially released as a Preview feature in 2.21.0.
Starting with today's release it is Generally Available 🤩
If you've been using this Preview feature, you can remove the
orderByAggregateGroup
flag frompreviewFeatures
in your Prisma Schema.Learn more about this feature in our documentation.
Order by Relation is Generally Available
Ever wondered how you can query posts and have the results ordered by their author's name?
With Order by Relations, you can do this with the following query:
Expand to view the underlying Prisma schema
Order by Relation was initially released in Preview in 2.16.0.
Starting with today's 3.0.1 release it is Generally Available 🧙
If you've been using this preview feature, you can remove the
orderByRelation
flag frompreviewFeatures
in your Prisma Schema.Learn more about this feature in our documentation.
Select Relation Count is Generally Available
Select Relation Count allows you to count the number of related records by passing
_count
to theselect
orinclude
options and then specifying which relation counts should be included in the resulting objects via anotherselect
.Select Relation Count helps you query counts on related models, for example, counting the number of posts per user:
Expand to view the structure of the returned `users`
```ts [ { id: 2, email: 'bob@prisma.io', city: 'London', name: 'Bob', _count: { posts: 2 }, }, { id: 1, email: 'alice@prisma.io', city: 'Berlin', name: 'Alice', _count: { posts: 1 }, }, ] ```If you've been using this Preview feature, you can remove the
selectRelationCount
flag frompreviewFeatures
in your Prisma Schema.Learn more about this feature in our documentation.
Breaking Changes
Some of the features above introduce breaking changes. In this section, we cover the breaking changes in more detail with links to upgrade guides in the documentation. We recommend that you read through the breaking changes carefully and make sure that you've upgraded and tested your application.
Named Constraints
Starting with Prisma 3, the names of database constraints and indexes are reflected in the Prisma schema. This means that Introspection with
db pull
as well asmigrate
anddb push
will work towards keeping your constraint and index names in sync between your schema and your database.Additionally, a new convention for default constraint names is now built into the Prisma Schema Language logic. This ensures reasonable, consistent defaults for new greenfield projects. The new defaults are more consistent and friendlier to code generation. It also means that if you have an existing schema and/or database, you will either need to migrate the database to the new defaults, or introspect the existing names.
Referential Actions
The default referential actions behaviors when you update or delete data changes between Prisma 2 and Prisma 3. This will lead to queries behaving differently in Prisma 3.x compared to Prisma 2.x.
In some cases, a delete operation will delete more data than previously. This is ****because in Prisma 2, cascading deletes and updates defined at the database level were prevented by Prisma Client, but will be allowed to happen in Prisma 3.
On relational databases, Prisma now relies on the database for referential actions — using
db pull
after you upgrade will reflect the actual behavior in your Prisma Schema.Please read the Referential Actions upgrade guide for a detailed explanation and steps to follow.
Seeding with
prisma db seed
,prisma migrate dev
,prisma migrate reset
The mechanism through which seeds are discovered changes. If you were already using seeding since Prisma 2.15.0, you will see a warning with steps to follow the next time seeding is triggered.
In summary, you will need to:
prisma.seed
in yourpackage.json
See the example above in the Major Improvements section and read the seeding docs for a complete explanation.
prisma db seed
. You will have to switch to the new mechanism.$queryRaw
API changesWe’ve taken this opportunity to cleanup
$queryRaw
and$executeRaw
. In Prisma 2.x, the Prisma Client had different behavior depending on how you called$queryRaw
or$executeRaw
:prisma.$queryRaw
...``. This API sent a prepared statement and was safe from SQL injections.prisma.$queryRaw(
...)
. This API sent a raw query string and was not safe from SQL injections.This was too subtle. Starting with Prisma 3, we've split our raw query APIs into "safe" and "unsafe":
$queryRaw
...``: Safe from SQL injections. Sends a prepared statement and returns the resulting rows.$executeRaw
...``: Safe from SQL injections. Sends a prepared statement and returns the result count.$queryRawUnsafe(
...)
: Not safe from SQL injections. Sends the query as a string and returns the resulting rows. Useful for queries that can't be prepared, like using a variable for the table name.$executeRawUnsafe(
...)
: Not safe from SQL injections. Sends the query as a string and returns the result count. Useful for queries that can't be prepared, like altering a column's data type.To update your application, you can do a "Find All" in your codebase for
$queryRaw(
and$executeRaw(
. Then you can either turn them into tagged templates or use the unsafe functions.Changes to how you query Null values on JSON fields
While Filtering on a Json field was in Preview, we learned from a community member that you couldn't filter a Json field by the JSON value null.
This is because
{ equals: null }
checks if the value in the database isNULL
, not if the value inside the column is a JSONnull
.To fix this problem, we decided to split "null" on Json fields into
JsonNull
,DbNull
andAnyNull:
Given the following model in your Prisma Schema:
Starting in 3.0.1, you'll see a TypeError if you try to filter by
null
on aJson
field:To fix this, you'll import and use one of the new null types:
This also applies to create, update and upsert. To insert a
null
value into a Json field, you would write:And to insert a database
NULL
into a Json field, you would write:Learn more about JSON filtering in our documentation.
Renamed Aggregate Fields
In 2.23.0, we announced that aggregate fields like
count
will be deprecated in favor of the prefixed notation, i.e._count
in order to avoid clashing with model fields names in your application.For example:
In this release, we're removing the deprecated old notation. You now must prefix your aggregate fields with an underscore.
To help with this transition, we suggest searching your codebase for
.aggregate({
and.groupBy({
, and prefixingcount
,max
,min
,avg
andsum
are all prefixed with an underscore, i.e._count
,_max
,_min
,_avg
, and_sum
.You can learn more about the original deprecation in the 2.23.0 Release Notes.
The minimum required version of Node.js is v12.6
Up until this release, Prisma supported versions 12.2 of Node.js and up
Starting with this release, the minimum required version of Node.js is 12.6.
Fixes and improvements
Prisma Migrate
microsoftSqlServer
preview flagdb seed
tests need to run on multiple platforms, not just UbuntureferentialActions
with Introspection and Migration CIreferentialActions
preview flagdb seed
featurePrisma Client
$queryRaw
availability isn't derived from the DMMFnull
values on JSONB fieldsorderByRelations
orderByAggregateGroup
selectRelationCount
$queryRaw("...")
to throw for JS calls$queryRaw(...)
to$queryRawUnsafe(...)
NOT
within aNOT
creates a SQL query with only a singleNOT
in 2.30.0count
should be_count
)Prisma
array_starts_with
andarray_ends_with
don't work on MariaDBLanguage tools (e.g. VS Code)
engineType
autocompletion supportPrisma Studio
npx prisma studio
throwsspawn undefined\System32\WindowsPowerShell\v1.0\powershell ENOENT
error on windowsCredits
Huge thanks to @saintmalik, @benkenawell, @ShubhankarKG, @hehex9 for helping!
📺 Join us for another "What's new in Prisma" livestream
Learn about the latest 3.0.1 release and other news from the Prisma community by joining Matt Muller and Daniel Norman from the Prisma team for another "What's new in Prisma" livestream.
The stream takes place on Youtube on Thursday, September 9 at 5pm Berlin | 8am San Francisco.
Configuration
📅 Schedule: "before 3am on Monday" (UTC).
🚦 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 this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.