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
🌟 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 the prisma db seed command. A few example use-cases include, but are not limited to:
Seeding different data in different environments
Partially seeding data in some tables
Here is an example seed.ts file that defines custom arguments for seeding different data in different environments:
// prisma/seed.tsimport{parseArgs}from"node:util";constoptions={environment: {type: 'string',},}asyncfunctionmain(){const{values: { environment }}=parseArgs({ options })switch(environment){case"development":
/** do something for development */break;case"test":
/** do something for test environment */break;default:
break;}}main()
You can then provide the environment argument when executing the seed script as follows:
npx prisma db seed -- --environment development
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:
The downloaded Query Engine doesn’t match the runtime/ target platform your application is running on.
The Query Engine is not copied to your final application bundle during the build step.
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 sync
Note:
This new approach is currently only available on Windows and Linux. We plan on adding support for the new file system watcher on macOS soon.
This requires both Prisma CLI & VS code extension version 4.15.0 or higher
Added Quick Fixes action for unique identifiers for MongoDB to add the @map("_id") attribute function when it’s missing on an identifier field
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.
🌟 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 running prisma 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:
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:
Adding a custom postinstall script in your package.json file
Manually adding a prisma 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:
Enabling the jsonProtocol Preview feature in your Prisma schema
Re-generating Prisma Client
Running your application or tests to make sure everything works
🌟 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 a views folder next to your Prisma schema.
Note: These .sql files are not yet used for creating or updating views during migrations yet. For now, we are only looking for feedback. Let us know if the introspected SQL files match the views picked up in your database and if the correct files were created in your filesystem.
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
🌟 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:
Does using this preview feature introduce any regressions or problems in your application?
If not, how does it influence the performance of your application? Can you share before and after measurements?
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.
🌟 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, it is necessary to use a different URL to connect to the database when using Prisma Client and Prisma Migrate.
We're introducing a new datasource property directUrl to improve this. When the directUrl property is present, the Prisma CLI will use it to connect to the database for tasks such as introspection and migrations.
### .env### Connection to Prisma Data Proxy. Used by Prisma Client.
DATABASE_URL="prisma://__HOST__/?api_key=__KEY__"### Connection to the database. Used for migrations and introspection.
DIRECT_URL="postgresql://__USER__:__PASSWORD__@​__HOST__:__PORT__/__DATABASE__"
We introduced initial support for database views in 4.9.0 with the addition of the view keyword. This release introduces introspection support for PostgreSQL views. You can run prisma db pull against your database to populate your Prisma schema with your views.
To learn more, refer to our documentation on views introspection. Try it out and let us know your thoughts in this GitHub issue.
Improved introspection for unsupported database functionality & partitioned tables
Currently, the Prisma Schema Language(PSL) does not cover the full feature sets of different database providers. For the unsupported database functionality, Prisma provides offers escape hatches like raw queries or manual editing of the migration files.
While we work on adding support for missing database functionality, e.g. database views, some of it is not fully-supported and the escape hatches fail. Objects that use unsupported properties might not be caught during introspection and raw queries might not work. Re-introspection may sometimes remove the information from the schema file and the generated migrations may be invalid or re-generate the same SQL repeatedly.
We're therefore fixing the defects and supporting the unsupported database functionalities Prisma currently doesn't support. We created a list of these features in this GitHub issue we would like to improve.
This release improves introspection support for partitioned tables in PostgreSQL and MySQL. Previously, Prisma would pick up the partitions as models and miss the actual main table. Prisma will now pick up the main table as a model, not the partitions.
If you're already using partitioned tables in your database, you can use prisma db pull to update your Prisma schema. If you're already using Prisma and want to partition a table in your database, you can:
Create a draft migration using prisma migrate dev --create-only
Update the draft migration with the SQL to partition the tables
Re-run prisma migrate dev to apply the draft migration to your database
Try it out and let us know what you think. If you run into an issue, feel free to create a bug report.
Smaller engine size used in Prisma CLI
In 4.8.0, we decreased the size of the engines by ~50%, which significantly impacted Prisma Client, especially in serverless environments.
In this release, we've reduced the size of Prisma CLI by removing the Introspection and Formatter engines. The introspection functionality is now served by the Migration Engine. A cross-platform Wasm module has entirely replaced the Formatter Engine. This reduces the overall installation size for Prisma CLI.
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Initial support for database views (Preview)
This release introduces a new keyword, view, behind the viewsPreview feature flag. You can manually add a view to your Prisma schema, which is ignored when running migrations. This is a small step forward but should already be helpful to many of you depending on workarounds and shell scripts to work with views and Migrate.
Here is an example usage of views:
generatorclient {provider="prisma-client-js"previewFeatures=["views"]}viewUserInfo {idInt @​id// from the User modelemailStringnameString// from the Profile modelbioString}modelUser {idInt @​id @​default(autoincrement())emailString @​uniquenameString?profileProfile?}modelProfile {idInt @​id @​default(autoincrement())bioStringuserUser @​relation(fields: [userId], references: [id])userIdInt @​unique}
To learn more, head to our documentation. Try it out and let us know your thoughts on this GitHub issue.
Multi-schema support for SQL Server (Preview)
We're thrilled to share that this release adds Preview support for multi-schema for SQL Server.
This release adds support for:
Introspecting databases that organize objects in multiple database schemas
Managing multi-schema database setups directly from Prisma schema
Generating migrations that are database schema-aware with Prisma Migrate
Querying across multiple database schemas with Prisma Client
If you already have a SQL Server database using multiple schemas, you can quickly get up and running and set up multiple schemas by:
Enabling the Preview feature in the Prisma schema
Defining the schemas in the schemas property in the datasource block
Introspecting your database using prisma db pull
You can further evolve your database schema using the multi-schema Preview feature by using prisma migrate dev.
For further details, refer to our documentation and let us know what you think in this GitHub issue.
Prisma Client Extensions improvements
In this release, we've made a number of improvements to the Prisma Client Extensions Preview feature:
Retrieving the current model name at runtime
You can now get the name of the current model at runtime using Prisma.getExtensionContext(this).name. You might use this to write out the model name to a log, to send the name to another service, or to branch your code based on the model. You can learn more about this in our docs.
Improved type safety when defining custom model methods
Prisma Client now provides a set of type utilities that tap into input and output types. They are fully dynamic, which means they adapt to any given model and schema. You can use them to improve your custom model methods' auto-completion. This is especially useful in shared extensions. Learn more about this in our docs.
Let us know what you think in this GitHub issue and in case you run into any issues, please create a bug report.
Introspection and Migration engine improvements
In this release, we moved the Introspection Engine (responsible for prisma db pull) which the Migration Engine will now serve. Previously, the Introspection Engine was stand-alone.
Let us know what you think in this GitHub issue and in case you run into any issues, please create a bug report.
MongoDB WriteConflict bug fix
This version also comes with a notable bug fix: In our MongoDB provider, any queries that are returned with a WriteConflict error Prisma now will retry the query, similar to how other MongoDB drivers and clients do.
We’re thrilled to announce Early Access to Accelerate.
Accelerate is a global database cache. It is available in 280 locations and has built-in connection pooling for serverless apps. You can make your queries up to 1000 times faster on any Prisma-supported database, reducing your query response times.
terraform
Running plan in Terraform Cloud. Output will stream here. Pressing Ctrl-C
will stop streaming the logs, but will not stop the plan running remotely.
Preparing the remote plan...
To view this run in a browser, visit:
https://app.terraform.io/app/CrimLog/dev/runs/run-QCsAGkrG79LvGTyZ
Waiting for the plan to start...
Terraform v1.4.5
on linux_amd64
Initializing plugins and modules...
data.aws_acm_certificate.cert: Refreshing...
aws_cloudwatch_log_group.log_group: Refreshing state... [id=/ecs/graphql-api-dev]
aws_iam_policy.fargate_policy: Refreshing state... [id=arn:aws:iam::043894507808:policy/graphql-api-dev-fargate-policy]
aws_ecs_cluster.cluster: Refreshing state... [id=arn:aws:ecs:us-east-1:043894507808:cluster/graphql-api-dev]
aws_default_vpc.vpc: Refreshing state... [id=vpc-0d6048d87526ca2aa]
aws_iam_role.ecs_task_execution_role: Refreshing state... [id=graphql-api-dev-execution-role]
aws_vpc.vpc: Refreshing state... [id=vpc-0dd1abc04eb78546a]
aws_internet_gateway.gw: Refreshing state... [id=igw-0f722e2ec075b406a]
aws_default_security_group.default: Refreshing state... [id=sg-061747dff8a994e8b]
aws_subnet.subnet["us-east-1d"]: Refreshing state... [id=subnet-0699b39f84d929a68]
aws_subnet.subnet["us-east-1b"]: Refreshing state... [id=subnet-068e99669610bf988]
aws_security_group.web_everyone2: Refreshing state... [id=sg-0ceb37cfb20b50043]
aws_vpc_peering_connection.peering_connection: Refreshing state... [id=pcx-02ca43ff46d27f622]
aws_lb_target_group.target_group: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:043894507808:targetgroup/graphql-api-dev/83e131544a9b44d8]
aws_security_group.graphql_api: Refreshing state... [id=sg-0cead3059c486959e]
aws_iam_role_policy_attachment.ecs-task-execution-role-policy-attachment2: Refreshing state... [id=graphql-api-dev-execution-role-20230428144451372400000001]
aws_ecs_task_definition.definition: Refreshing state... [id=graphql-api-dev-task]
aws_iam_role_policy_attachment.ecs-task-execution-role-policy-attachment1: Refreshing state... [id=graphql-api-dev-execution-role-20230428144451387600000002]
aws_route.vpc_peering_route: Refreshing state... [id=r-rtb-09b02ae3a536a3f7a2811395018]
aws_default_route_table.default: Refreshing state... [id=rtb-0209f8b11e4513cc2]
aws_lb.alb: Refreshing state... [id=arn:aws:elasticloadbalancing:us-east-1:043894507808:loadbalancer/app/graphql-api-dev-alb/252731848262f1ac]
aws_ecs_service.service: Refreshing state... [id=arn:aws:ecs:us-east-1:043894507808:service/graphql-api-dev/graphql-api-dev-svc]
aws_lb.alb: Drift detected (delete)
aws_security_group.graphql_api: Drift detected (delete)
aws_ecs_task_definition.definition: Drift detected (update)
aws_ecs_cluster.cluster: Drift detected (delete)
aws_default_vpc.vpc: Drift detected (delete)
aws_vpc_peering_connection.peering_connection: Drift detected (delete)
aws_internet_gateway.gw: Drift detected (delete)
aws_default_security_group.default: Drift detected (delete)
aws_route.vpc_peering_route: Drift detected (delete)
aws_ecs_service.service: Drift detected (delete)
aws_security_group.web_everyone2: Drift detected (delete)
aws_vpc.vpc: Drift detected (delete)
aws_default_route_table.default: Drift detected (delete)
aws_subnet.subnet["us-east-1b"]: Drift detected (delete)
aws_subnet.subnet["us-east-1d"]: Drift detected (delete)
╷
│ Error: no certificate for domain "crimlog.org" found in this Region
│
│ with data.aws_acm_certificate.cert,
│ on lb.tf line 51, in data "aws_acm_certificate" "cert":
│ 51: data "aws_acm_certificate" "cert" {
│
╵
Operation failed: failed running terraform plan (exit 1)
Pushed by: @renovate[bot], Action: pull_request, Environment: dev
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
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.15.04.6.1->4.15.0Release Notes
prisma/prisma
v4.15.0Compare 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 seedThis 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 seedcommand. A few example use-cases include, but are not limited to:Here is an example
seed.tsfile that defines custom arguments for seeding different data in different environments:You can then provide the
environmentargument 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 generateis 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 EPIPEon WSL <-> Windowsprisma generateis blocked byquery-engine-rhel-openssl-1.0.xopening in Notepad on Windowsnode_modules(from another platform) leads to platform engine not being presentoutputQuery engine library for current platform "rhel-openssl-1.0.x" could not be found. You incorrectly pinned it to rhel-openssl-1.0.xCannot find name '$PrismaModel'due to featureextendedWhereUniquewith preview featurefieldReferenceDatevalues silently turn intonullsfieldReferenceis not working with enumsPrisma Migrate
prisma db seedto 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.1Compare Source
Today, we are issuing the
4.14.1patch release.Fix in Prisma Client
v4.14.0Compare 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
clientleads 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:44inargument of filter types does not accept scalarsjsonProtocolshould report errors as nicely as beforeclient:ENOENT: no such file or directory, open 'D:\<projectpath>\node_modules\.prisma\client\schema.prismaPrisma Migrate
Please create an issue ...inMigrateEngine.tsDbPull.tsto the engineviewsfolder 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.0Compare 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 pulldid not pick up the unsupported features in a database. It was easy to lose them when runningprisma migrate devbased 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 LASTPrisma 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-functionalityon 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
postinstallscripts of these dependencies will not be executed.Prisma uses a
postinstallscript 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:
postinstallscript in yourpackage.jsonfileprisma generatestep 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
jsonProtocolPreview 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:
jsonProtocolPreview 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 generatefails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarnnode_modulescache that contains generated Clientprisma generatewhen@prisma/clientis not installed in projectpnpm installhangs on@prisma/clientpostinstallPrisma 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.0Compare 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
viewsPreview feature significantly improved this release:prisma db pullnow reads the SQL query used to define a view and stores it in a.sqlfile in aviewsfolder 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
jsonProtocolPreview 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
tracingPreview feature) and logging to Prisma Client for Data Proxy.Fixes and improvements
Prisma Migrate
db pullfail with particular enum default value in columnPrisma Client
findUniqueused withPromise.allreturnsnullPrismaPromiseexport after update from 4.9.0 to 4.11.0Unique constraint failed on the fieldson query that worked in 4.10.1jsonProtocolField/Enum is not included in the result of the findFirst/findMany functionLanguage tools (e.g. VS Code)
typeblock 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.0Compare 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
jsonProtocolPreview 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
jsonProtocolto 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 pullagainst 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.jsfile 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'ENOENTwith custom output and ESM module in NPM monorepo (including Nextjs):no such file or directory, open /.../schema.prisma...ignoreEnvVarErrors: trueNode API QE causesdatasourceOverridesto be ignoredPrisma Migrate
db pull: add new codes for introspection warnings for views in the CLIdirectUrlisprisma://connection stringerrorCode: 'P1012' PrismaClientInitializationError: error: Environment variable not found: DATABASE_URL.directUrlenv var value, leading to validation error (Affects PDP/Data Proxy and normal Engine)validateto returnResult<(), JsError>inWasmmoduleCredits
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.1Compare Source
Today, we are issuing the
4.10.1patch release.Fixes in Prisma Client
v4.10.0Compare 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, it is necessary to use a different URL to connect to the database when using Prisma Client and Prisma Migrate.
We're introducing a new datasource property
directUrlto improve this. When thedirectUrlproperty is present, the Prisma CLI will use it to connect to the database for tasks such as introspection and migrations.To learn more, refer to our documentation.
Introspection support for PostgreSQL views
We introduced initial support for database views in 4.9.0 with the addition of the
viewkeyword. This release introduces introspection support for PostgreSQL views. You can runprisma db pullagainst your database to populate your Prisma schema with your views.To learn more, refer to our documentation on views introspection. Try it out and let us know your thoughts in this GitHub issue.
Improved introspection for unsupported database functionality & partitioned tables
Currently, the Prisma Schema Language(PSL) does not cover the full feature sets of different database providers. For the unsupported database functionality, Prisma provides offers escape hatches like raw queries or manual editing of the migration files.
While we work on adding support for missing database functionality, e.g. database views, some of it is not fully-supported and the escape hatches fail. Objects that use unsupported properties might not be caught during introspection and raw queries might not work. Re-introspection may sometimes remove the information from the schema file and the generated migrations may be invalid or re-generate the same SQL repeatedly.
We're therefore fixing the defects and supporting the unsupported database functionalities Prisma currently doesn't support. We created a list of these features in this GitHub issue we would like to improve.
This release improves introspection support for partitioned tables in PostgreSQL and MySQL. Previously, Prisma would pick up the partitions as
models and miss the actual main table. Prisma will now pick up the main table as amodel, not the partitions.If you're already using partitioned tables in your database, you can use
prisma db pullto update your Prisma schema. If you're already using Prisma and want to partition a table in your database, you can:prisma migrate dev --create-onlyprisma migrate devto apply the draft migration to your databaseTry it out and let us know what you think. If you run into an issue, feel free to create a bug report.
Smaller engine size used in Prisma CLI
In 4.8.0, we decreased the size of the engines by ~50%, which significantly impacted Prisma Client, especially in serverless environments.
In this release, we've reduced the size of Prisma CLI by removing the Introspection and Formatter engines. The introspection functionality is now served by the Migration Engine. A cross-platform Wasm module has entirely replaced the Formatter Engine. This reduces the overall installation size for Prisma CLI.
Fixes and improvements
Prisma Client
aarch64-unknown-linux-musltarget (Alpine Linux on ARM, e.g. M1)getDmmfas Wasm module that could be used in Prisma CLIPrisma
prisma-fmtformatter binaryintrospection-enginebinary from CLIget-platformerror for non-amd64Alpine introduced inprisma@4.9.0prevents using custom Prisma enginesError: Unknown binaryTarget debian-openssl-0.0.x and no custom engine files were providedafter upgrading from 4.8.1 to 4.9.0Language tools (e.g. VS Code)
referentialIntegrityin favor ofrelationModedirectUrlCredits
Huge thanks to @rintaun, @ivan, @Mini256, @yukukotani, @sandrewTx08 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, February 9 at 5 pm Berlin | 8 am San Francisco.
v4.9.0Compare Source
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
Highlights
Initial support for database views (Preview)
This release introduces a new keyword,
view, behind theviewsPreview feature flag. You can manually add aviewto your Prisma schema, which is ignored when running migrations. This is a small step forward but should already be helpful to many of you depending on workarounds and shell scripts to work with views and Migrate.Here is an example usage of
views:To learn more, head to our documentation. Try it out and let us know your thoughts on this GitHub issue.
Multi-schema support for SQL Server (Preview)
We're thrilled to share that this release adds Preview support for multi-schema for SQL Server.
This release adds support for:
If you already have a SQL Server database using multiple schemas, you can quickly get up and running and set up multiple schemas by:
schemasproperty in thedatasourceblockprisma db pullYou can further evolve your database schema using the multi-schema Preview feature by using
prisma migrate dev.For further details, refer to our documentation and let us know what you think in this GitHub issue.
Prisma Client Extensions improvements
In this release, we've made a number of improvements to the Prisma Client Extensions Preview feature:
Retrieving the current model name at runtime
You can now get the name of the current model at runtime using
Prisma.getExtensionContext(this).name. You might use this to write out the model name to a log, to send the name to another service, or to branch your code based on the model. You can learn more about this in our docs.Improved type safety when defining custom model methods
Prisma Client now provides a set of type utilities that tap into input and output types. They are fully dynamic, which means they adapt to any given model and schema. You can use them to improve your custom model methods' auto-completion. This is especially useful in shared extensions. Learn more about this in our docs.
Let us know what you think in this GitHub issue and in case you run into any issues, please create a bug report.
Introspection and Migration engine improvements
In this release, we moved the Introspection Engine (responsible for
prisma db pull) which the Migration Engine will now serve. Previously, the Introspection Engine was stand-alone.Let us know what you think in this GitHub issue and in case you run into any issues, please create a bug report.
MongoDB
WriteConflictbug fixThis version also comes with a notable bug fix: In our MongoDB provider, any queries that are returned with a
WriteConflicterror Prisma now will retry the query, similar to how other MongoDB drivers and clients do.Prisma plugin for JetBrains IDEs
If you are using a JetBrains IDE the team over at JetBrains recently released an official Prisma plugin in their Plugin Marketplace.
Thank you, @JetBrains, for working on this! Next to our VS Code extension for Prisma and our general language server, which works in many editors, most relevant editors should now be covered.
Accelerate (Early Access)
We’re thrilled to announce Early Access to Accelerate.
Accelerate is a global database cache. It is available in 280 locations and has built-in connection pooling for serverless apps. You can make your queries up to 1000 times faster on any Prisma-supported database, reducing your query response times.
Join the waiting list for Accelerate here.
Fixes and improvements
Prisma
opensslorlibcinstallation to improve snapshot testing suite--schemasparam to thedb pullcommandschemasproperty different when cross schema references are detected (whenmultiSchemapreview feature is enabled)db pullwithmultiSchemaenabled andschemasdefined, outputspublicin CLI message anywayschemasproperty indatasource@@​schemaattributedebiandistrosmultiSchema: addschemasproperty togetConfigoutputmigrate resetwith sqlserver does not delete second schemaopenssldetection for Linux distros besides Alpine and Debian-based distros, like RHELThese enums were enriched with@@map` informConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ 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 Mend Renovate. View repository job log here.