feat(deps): update prisma to 2.23.x #1072
Merged
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.21.x
->2.23.x
2.21.2
->2.23.0
2.21.2
->2.23.0
2.21.2
->2.23.0
2.21.2
->2.23.0
2.21.2
->2.23.0
Release Notes
prisma/prisma
v2.23.0
Compare Source
Today, we are excited to share the
2.23.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
JSON Filtering is now in Preview
Starting today, you can now filter rows by data inside a
Json
type. JSON filtering support is available in PostgreSQL and MySQL. You can try it today by adding thefilterJson
preview flag to yourgenerator
block. This has been one of our most popular feature requests, so we're very excited to be getting it into your hands!To get an idea of how JSON filtering works, let's see how you might query application logs stored in your database. Given the following Prisma schema:
And the following records in your PostgreSQL database:
INFO
{"host": "bob"}
INFO
{"host": "alice", "request_id": 10}
INFO
{"host": "alice", "amount": 20, "request_id": 10}
ERROR
{"host": "alice", "amount": 20, "request_id": 10}
INFO
{"host": "bob", "request_id": 1}
INFO
{"host": "alice"}
INFO
{"host": "bob", "email": "james@gmail.com", "request_id": 1}
We can now filter logs by the data inside the
meta
field. Let's query by therequest_id
inside themeta
field to track the journey that led up to the error.We can write the following query:
Giving us the entire journey of this person's request:
Please note that the
path
syntax varies depending on the database. We pass thepath
query directly to the database, so there will be syntactical differences.For example, querying by key in Postgres is
request_id
, while in MySQL it would be$.request_id
. Please consult your database's documentation to learn more.If you run into any questions or have any feedback, we're available in this issue.
Improvement for
prisma db seed
In previous versions, a seed file could only be executed as a script.
prisma db seed
was simply executing the script by either callingnode ./prisma/seed.js
for JavaScript orts-node ./prisma/seed.ts
for TypeScript.Now, you can directly export a function that Prisma executes on your behalf. Here's the rules that describe the new behavior: Prisma checks if the seed file has ...
seed
and executes itIf there's no function exported as
seed
or via a default export, the behaviour ofprisma db seed
is exactly the same as before, meaning it will simply be executed as a script file.Breaking changes
Options in
groupBy
queries are now prefixed with an underscoreThe options in
groupBy
are now prefixed with an underscore, for example:Here's an overview of the exact changes of each option:
2.23.0
2.23.0
and latercount
_count
max
_max
min
_min
avg
_avg
sum
_sum
Note that this also changes the names of the fields in the objects that are returned by Prisma Client. For example, in the above case you now access the returned count value like so:
We made this change to avoid clashes with user-defined fields. You can learn more about the problem in these issues.
We're sorry for the inconvenience! If you have any questions or need any help, please reach out in this discussion.
Deprecations
Deprecating options in
aggregate
queriesWith the changes to
groupBy
discussed above and recent features like orderBy an aggregate, we took this opportunity to unifymin
,max
,avg
,sum
andcount
keywords across Prisma Client queries.Similar tpo
groupBy
, this is the case for all of our aggregations:2.23.0
2.23.0
and latercount
_count
max
_max
min
_min
avg
_avg
sum
_sum
This is not a breaking change. The aggregate queries you wrote prior to
2.23.0
will continue to work as expected. We ask that you make adjustments when you can to future-proof your application.If you have any questions or need any help, please reach out in this discussion.
Fixes and improvements
Prisma Migrate
dbgenerated("gen_random_uuid()::TEXT")
Option::unwrap()
on aNone
valueError: Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls
in 2.22.0Prisma Client
Prisma Studio
Prisma Engines
Credits
Huge thanks to @Sytten, @schiller-manuel, @mongolyy, @paularah, @Iamshankhadeep, @meeq for helping!
📺 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, May 20 at 5pm Berlin | 8am San Francisco.
🌎 Prisma Day is coming
Save the date for Prisma Day 2021 and join us for two days of talks and workshops by the most exciting members of the Prisma community.
We look forward to seeing you there!
v2.22.1
Compare Source
Today, we are issuing the
2.22.1
patch release.Fix
Prisma CLI
v2.22.0
Compare Source
Today, we are excited to share the
2.22.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
prisma db push
is now Generally Availableprisma db push
enables you to update the database schema from the Prisma schema file, without generating any migrations.This is especially useful when prototyping a new feature, iterating on the schema changes before creating migrations or generally if you are at stage of your development process, where you don't need to persist the schema change history via database migrations.
It is now promoted from Preview to General Availabilty.
You can find more info on
prisma db push
in the official docs.Deprecation of array notation for
provider
fieldsIn this release, we are also entirely removing the array notation for the
provider
fields ondatasource
blocks. This has been deprecated since 2.11.0 (November 2020).You can read more about our reasons for this deprecation here.
Prisma Client Go gets support for
AND
operatorWe've always had
OR
, but this release we also addedAND
support:Learn more in our docs.
Fixes and improvements
Prisma Migrate
provider
as known error that does not trigger Error ReportingOption::unwrap()
on aNone
valueprisma migrate deploy
autoincrement()
default value is used on a non-indexed field even though the datasource does not support this."migrate dev
with shadow database errors with "Database already exists FKAddressuserId" when migration fails because of existing foreign keyPrisma Client
Prisma Studio
Prisma engines
Credits
Huge thanks to @Sytten, @schiller-manuel, @mongolyy, @paularah, @Iamshankhadeep, @meeq for helping!
📺 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, May 06 at 5pm Berlin | 8am San Francisco.
Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Renovate will not automatically rebase this PR, because other commits have been found.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by WhiteSource Renovate. View repository job log here.