Update prisma monorepo to v2.30.3 (minor) #263
Closed
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.16.1
->2.30.3
2.16.1
->2.30.3
Release Notes
prisma/prisma
v2.30.3
Compare Source
Today, we are issuing the
2.30.3
patch release.Improvements
Prisma CLI
Fixes
Prisma Studio
npx prisma studio
throwsspawn undefined\System32\WindowsPowerShell\v1.0\powershell ENOENT
error on windowsv2.30.2
Today, we are issuing the
2.30.2
patch release.Fixes
Prisma Client
NOT
within aNOT
creates a SQL query with only a singleNOT
in 2.30.0v2.30.0
Compare Source
Today, we are excited to share the
2.30.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
New features & improvements
Full-Text Search for PostgreSQL is now in Preview 🚀
We're excited to announce that Prisma Client now has preview support for Full-Text Search on PostgreSQL.
You can give this a whirl in 2.30.0 by enabling the
fullTextSearch
preview flag:After you regenerate your client, you'll see a new
search
field on yourString
fields that you can query on. Here are a few examples:You can learn more about how the query format works in our documentation. We would love to know your feedback! If you have any comments or run into any problems we're available in this in this Github issue.
Validation errors for referential action cycles on Microsoft SQL Server ℹ
Microsoft SQL Server has validation rules for your schema migrations that reject schema changes that introduce referential action cycles.
These scenarios tend to show up often for developers using the
referentialActions
preview feature, which will become the default. The database error you get is not really helpful, so to provide a better experience, Prisma now checks for referential cycle actions when it validates your schema file and shows you the exact location of the cycle in your schema.To learn more, check out the documentation.
prisma introspect
is being deprecated in favor ofprisma db pull
👋🏻The
prisma introspect
command is an alias forprisma db pull
so they are the same command. However,prisma db pull
is more intuitive since it pulls the schema from the database into your localschema.prisma
file. This naming also works as the counterpart ofprisma db push
.Starting with this release, you will get a warning that encourages you to use
prisma db pull
instead ofprisma introspect
.Prisma Adopts Semantic Versioning (SemVer)
As previously announced, we are adjusting our release policy to adhere more strictly to Semantic Versioning.
In the future, breaking changes in the stable development surface i.e. General Availability will only be rolled out with major version increments.
You can learn more about the change in the announcement blog post.
Fixes and improvements
Prisma Client
findUnique
$queryRaw
and$executeRaw
in 2.29.0.catch()
or.finally()
on a prisma client model query does not fire the request in 2.29.0Prisma Migrate
Bytes
@id
columns with SQL ServerLanguage tools (e.g. VS Code)
@relation()
@prisma/engines npm package
Credits
Huge thanks to @saintmalik 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, August 26 at 5pm Berlin | 8am San Francisco.
v2.29.1
Compare Source
Today, we are issuing the
2.29.1
patch release.Fixes
Prisma Client
v2.29.0
Compare Source
Today, we are excited to share the
2.29.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
Interactive Transactions are now in Preview
Today we’re introducing Interactive Transactions – one of our most debated feature requests.
Interactive Transactions are a double-edged sword. While they allow you to ignore a class of errors that could otherwise occur with concurrent database access, they impose constraints on performance and scalability.
While we believe there are better alternative approaches, we certainly want to ensure people who absolutely need them have the option available.
You can opt-in to Interactive Transactions by setting the
interactiveTransactions
preview feature in your Prisma Schema:Note that the interactive transactions API does not support controlling isolation levels or locking for now.
You can find out more about implementing use cases with transactions in the docs, and share your feedback.
Named Constraints are now in Preview
Named Constraints allow you to represent (when using introspection) and specify (when using Prisma Migrate) the names of constraints of the underlying database schema in your Prisma schema.
Before this release, you could only specify the underlying database constraint names for
@@​unique
and@@​index
. This meant that you didn't have control over all constraint names in the database schema. In projects that adopted Prisma with introspection, some constraint names from the database were not represented in the Prisma schema. This could lead to the database schema across environments getting out of sync when one environment was introspected, and another was created with Prisma Migrate and had different constraint names.Starting with this release, you can specify the underlying database constraint names for
@id
,@@​id
,@unique
, and@relation
constraints.You can opt-in to Named Constraints by adding the
namedConstraints
preview feature to your Prisma Schema:After enabling the
namedConstraints
preview flag, you can specify the names of constraints in the database schema using themap
attribute:@id(map: "custom_primary_key_constraint_name")
@@​id([field1, field2], map: "custom_compound_primary_key_name")
@unique(map: "custom_unique_constraint_name")
@@​unique([field1, field2], map: "custom_compound_unique_constraint_name")
@@​index([field1, field2], map: "custom_index_name")
@relation(fields: [fieldId], references: [id], map: "custom_foreign_key_name")
After specifying the
map
attribute, Prisma Migrate will use it when creating migrations.When using
prisma db pull
withnamedConstraints
, these names will be automatically populated in your Prisma schema unless they match our default naming convention (which follows the Postgres convention). When handwriting a Prisma schema, these names are optional and will alternatively be filled with the default names by Prisma under the hood.The
name
argument in@@​unique
and@@​id
In addition to the
map
argument, the@@​unique
and the@@​id
attributes have thename
argument (optional) that Prisma uses to generate theWhereUnique
argument in the Prisma Client API.For example, given the following model:
The following Prisma Client query is valid:
By adding the
name
argument to the@@​id
attribute:The following query is valid:
Note: For the
@@​unique
attribute this functionality was already available in previous releases. For@@​id
this is new.You can learn more about
namedConstraints
in our documentation.Please check our upgrade guide before enabling the preview flag and running migrate operations for the first time. It explains what to do if you either want to keep the existing names in your database or want to switch to the default names for a cleaner Prisma schema.
Prisma Adopts Semantic Versioning (SemVer)
As previously announced, we are adjusting our release policy to adhere more strictly to Semantic Versioning.
In the future, breaking changes in the stable development surface i.e. General Availability will only be rolled out with major version increments.
You can learn more about the change in the announcement blog post.
Fixes and improvements
Prisma Client
updateMany
does not update the updatedAt timestamps for related records properlyPrisma Migrate
Introducing FOREIGN KEY constraint '...' on table '...' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
--forceExit
introspect --url
outputs additional lines which make output result unusableconfig.datasources[0].provider
from GetConfig needs to be a string and not a string[]bar
specified for the@@​unique
attribute is already used as a name for a field. Please choose a different name.Credits
Huge thanks to @benkenawell 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, March 04 at 5pm Berlin | 8am San Francisco.
v2.28.0
Compare Source
Today, we are excited to share the
2.28.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release. 🌟
MongoDB improvements 🚀
Thanks to your feedback, we fixed a handful of bugs reported on the MongoDB connector (Preview):
findUnique
queries leading to an error #8276Please keep reporting issues to our team and help to bring MongoDB support closer to GA!
Prisma Adopts Semantic Versioning (SemVer)
We are adjusting our release policy to adhere more strictly to Semantic Versioning.
In the future, breaking changes in the stable development surface i.e. General Availability will only be rolled out with major version increments.
You can learn more about the change in the announcement blog post.
Create new Prisma projects in under 3 minutes ⏳
The latest release of the Prisma Data Platform enables you to create new Prisma projects and provision a database in under 3 minutes.
The Prisma Data Platform already allows you to:
The new onboarding flow makes it possible to get started with Prisma quickly for new Prisma projects! 🚀
When creating a new Prisma project, the Prisma Data Platform allows you to:
If you already have a Prisma project, you can continue to import it from GitHub and connect it to your database.
This whole process now takes less than 3 minutes to set up, so we’re looking forward to seeing how you will use this feature for your prototyping and production needs.
If you have any issues or questions, let us know by opening a GitHub issue.
Quick overview
If you have a Heroku account, we can create a free Postgres database for you:
Start your project with a schema from our templates:
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
Fixes and improvements
Prisma Client
Prisma Migrate
migrate dev
leads to error messageERROR: cannot drop view pg_buffercache because extension pg_buffercache requires it HINT: You can drop extension pg_buffercache instead.
Prisma Studio
"
.Credits
Huge thanks to @ShubhankarKG, @hehex9 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, July 15 at 5pm Berlin | 8am San Francisco.
v2.27.0
Compare Source
Today, we are excited to share the
2.27.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo ☝️ or tweeting about the release. 🌟
Major improvements & new features
MongoDB is Now in Preview 🎉
We're thrilled to announce that Prisma now has Preview support for MongoDB. Here's how to get started:
Inside your
schema.prisma
file, you'll need to set the database provider tomongodb
. You'll also need to addmongoDb
to thepreviewFeatures
property in thegenerator
block:Next, you'll need to add a database connection string to your
.env
file. We recommend using MongoDB Atlas to spin up a MongoDB database for free. Set theDATABASE_URL
to the connection string you got from MongoDB Atlas, it should be similar to the following string:Then you can run
npx prisma generate
to generate a MongoDB-compatible Prisma Client. The Prisma Client API is the same for Mongo as it is for other supported relational databases (PostgreSQL, MySQL, SQLite and Microsoft SQL Server).To test that everything works, you can run the following script:
You should see a new post created and added to your database! You can use Prisma Studio to view the record you just added by running
npx prisma studio
.This is just the tip of the iceberg. Learn more in our Getting Started Guide.
We would love to know your feedback! If you have any comments or run into any problems we're available in this issue. You can also browse existing issues that have the MongoDB label.
Prisma native support for M1 Macs 🚀
This one's for our Mac users. Prisma now runs natively on the new M1 chips. Best of all, there's nothing to configure, it just works. Enjoy the speed bump!
Fixes and improvements
Prisma Client
pnpm
do not play well togetherPrisma Migrate
ERROR 70100 (1317): foreign key constraints are not allowed, see https://code.openark.org/blog/mysql/the-problem-with-mysql-foreign-key-constraints-in-online-schema-changes
ERROR HY000 (1105): direct DDL is disabled
migrate dev
and PostGis Viewsprisma init
for datasource providers in Preview/EarlyAccess📺 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, July 15 at 5pm Berlin | 8am San Francisco.
v2.26.0
Compare Source
Today, we are excited to share the
2.26.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
Referential Actions now enable cascading deletes and updates (Preview)
In this release we are introducing a new feature in Preview which enables fine-grained control over referential actions
ON DELETE
andON UPDATE
for the foreign keys supporting relations in Prisma models.Current behavior
Until now, Prisma created a foreign key for each relation between Prisma models with the following defaults:
ON DELETE CASCADE ON UPDATE CASCADE
. In addition, when invoking thedelete()
ordeleteAll()
methods, Prisma Client performs runtime checks and will prevent the deletion of records on required relations if there are related objects referencing it, effectively preventing the cascade delete behavior. When using raw SQL queries for deletion, Prisma Client won't perform any checks, and deleting a referenced object will effectively cause the deletion of the referencing objects.Example:
prisma.user.delete(...)
andprisma.user.deleteAll()
will fail if the user has posts.Using raw SQL, e.g. using
$queryRaw()
to delete the user will trigger the deletion of its posts.New behavior
The feature can be enabled by setting the preview feature flag
referentialActions
in thegenerator
block of Prisma Client in your Prisma schema file:With the feature enabled, the behavior is now the following:
prisma db push
, and introspection will set these in the database schema, e.g.@relation(... onDelete: SetNull)
will set translate toON DELETE SET NULL
on the corresponding foreign key. See Syntax section below.onDelete
oronUpdate
attributes in@relation
are not present, default values are used:ON DELETE RESTRICT
(NO ACTION
on SQL Server) for required relationsON DELETE SET NULL
for optional relationsON UPDATE CASCADE
for all relations regardless if optional or required.prisma db push
, and introspection will rely on the syntax and default values above to keep the referential actions between Prisma schema and database schema in sync.delete()
ordeleteAll()
methods. Deleting referenced objects will succeed or not depending on the underlying foreign keys of relations, e.g. by default deletion will be prevented by the database because it's set toON DELETE RESTRICT
, but will succeed if set toON DELETE CASCADE
.onDelete
oronUpdate
attributes in the Prisma schema, the next time the database is updated with Prisma Migrate orprisma db push
, the database schema will be updated to use the default values on all foreign keys,ON DELETE RESTRICT ON UPDATE CASCADE
(ON DELETE NO ACTION ON UPDATE CASCADE
on SQL Server).Please note that until then, if the database schema is managed using Prisma Migrate or
prisma db push
, the existing defaults are probably in place (ON DELETE CASCADE ON UPDATE CASCADE
), and this could lead to deletion of records in conditions where a deletion was previously prevented by Prisma Client until the foreign key constraints are updated.Syntax
The semantics of
onDelete
andonUpdate
are almost exactly how SQL expressesON UPDATE
andON DELETE
. For the example below:User
) of aPost
is deleted (onDelete
), delete allPost
rows that are referencing the deletedUser
(Cascade
).id
field of the relatedUser
is updated, also updateauthorId
of allPost
s that reference thatUser
.Possible keywords for
onDelete
andonUpdate
are:Cascade
,Restrict
(except SQL Server),NoAction
,SetNull
,SetDefault
.If you run into any questions or have any feedback, we're available in this issue.
Limitations
SetNull
on a required relation will lead to database errors when deleting referenced records because the non-nullable constraint would be violated.prisma init
now accepts a--datasource-provider
argumentThe
prisma init
command now accepts a--datasource-provider
argument that lets you configure the defaultprovider
for the initially generateddatasource
block in your Prisma schema. The possible values for this argument are equivalent to the allowed values for theprovider
field ondatasource
blocks:postgresql
(default)mysql
sqlite
sqlserver
(Preview, needs themicrosoftSqlServer
preview feature flag)Here's an example that shows how to configure the initial Prisma schema skeleton with a SQLite database:
Node-API Improvements
The Prisma Client currently communicates to Prisma's Query Engine over either HTTP or Unix domain sockets. After some experimentation, we realized we can improve this communication overhead by using Node-API, which provides direct memory access across processes.
We've been working the last couple of weeks to get ready to make Node-API the default way we communicate with the Query Engine. To prepare for this change, we fixed a bunch of bugs and we'd love for you to give it another try:
Right now we're still compiling benchmarks, but you should see a nice speed boost by opting into Node-API. You can reach us in this issue if you run into anything!
Fixes and improvements
Prisma Client
join
raw query helper with SQL Servergenerate
givesTypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
orTypeError: outputDir.endsWith is not a function
error and no helpful outputQuery engine exited with code 101 - thread 'main' panicked at 'Could not open datamodel file "/schema.prisma"...'
Engine is not yet connected.
CI test with Node-APIPrisma Migrate
onDelete CASCADE
, this should be configurable.Introducing FOREIGN KEY constraint '...' on table '...' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Prisma
binaryTargets: env("..")
insidegenerator client
sectionCredits
Huge thanks to @B2o5T for helping!
🌎 Prisma Day is happening today!
Prisma Day is a two-day event of talks and workshops by members of the Prisma community, on modern application development and databases. It's taking place June 29-30th and is entirely online.
We look forward to seeing you there!
📺 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, July 01 at 5pm Berlin | 8am San Francisco.
v2.25.0
Compare Source
Today, we are excited to share the
2.25.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
Human-readable drift diagnostics for
prisma migrate dev
Database schema drift occurs when your database schema is out of sync with your migration history, i.e. the database schema has drifted away from the source of truth.
With this release, we improve the way how the drift is printed to the console when detected in the
prisma migrate dev
command. While this is the only command that uses this notation in today's release, we plan to use it in other places where it would be useful for debugging in the future.Here is an example of how the drift is presented with the new format:
Support for
.env
files in Prisma Client GoYou can now use a
.env
file with Prisma Client Go. This makes it easier to keep database credentials outside your Prisma schema and potentially work with multiple clients at the same time:Learn more about using the
.env
file in our documentation.Breaking change
Dropping support for Node.js v10
Node.js v10 reached End of Life on April 30th 2021. Many of our dependencies have already dropped support for Node.js v10 so staying up-to-date requires us to drop Node.js v10, too.
We recommend upgrading to Node.js v14 or greater for long-term support. You can learn more about Node.js releases on this page.
Fixes and improvements
Prisma Client
createMany
errors with:PANIC in query-engine/connectors/sql-query-connector/src/database/operations/write.rs:95:60called
Result::unwrap()on an
Errvalue: ScalarFieldNotFound { name: "updated_at", model: "FundMangerTeamMemberExperience" }
params
in Middleware testsprisma generate
doesn't install prisma client 2.24.xPrisma Migrate
Option::unwrap()
on aNone
valuedb push
/migrate
is hiding the binary download process duringgenerate
, leading to confusionshadowDatabaseUrl
from schemaPrisma Studio
Credits
Huge thanks to @82600417, @SuryaElavazhagan, @psavan1655 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, June 17 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.24.1
Compare Source
Today, we are issuing the
2.24.1
patch release.Fixes
Prisma Client
v2.24.0
Compare Source
Today, we are excited to share the
2.24.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Major improvements & new features
MongoDB gets
Json
andEnum
SupportWe just added
Json
andenum
support to the MongoDBprovider
for Prisma Client. Here's an example with both:You can then use the generated client like this:
As a reminder, the
mongodb
provider is still in Early Access. If you'd like to use MongoDB with Prisma, please fill out this 2-minute Typeform and we'll get you an invite to our Getting Started Guide and private Slack channel right away!New features for the Prisma Data Platform
The Prisma Data Platform (PDP) helps developers collaborate better in projects that are using the open-source tools. One of its main features today is an online data browser.
View schema
You can now view your project's schema in order to better understand your application or collaborate with your colleagues. The only roles that can view it are: Admin and Developer
Expand for a screenshot of the new schema view
You can now delete your project from your settings.
Expand for a screenshot of the new settings
You can also edit your Project's URL, so you can now correct any mistakes you might have made while creating your project.
Static IPs are now supported
If your database is behind a proxy and you need a static IP to allowlist in order to give access to it, you can now get in touch with us by creating an issue or sending an email at
[email protected]
and we'll enable it for you.Please note that while this feature is freely available now, it will be offered as part of a paid plan in the future (towards the end of '21 or beginning of '22).
Fixes and improvements
Prisma Client
Result::unwrap()
on anErr
value: FieldNotFound { name: "_count", model: "Post" }Prisma Migrate
Prisma Studio
Prisma Engines
Credits
Huge thanks to @Sytten 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, June 3rd 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.23.0
](https://togithub.com/prisma/prisConfiguration
📅 Schedule: "before 7am on Tuesday" in timezone Australia/Sydney.
🚦 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 WhiteSource Renovate. View repository job log here.