Update prisma monorepo to v7 (major) #715
Open
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:
^6.3.1->^7.0.0^6.3.1->^7.0.0^6.3.1->^7.0.0Release Notes
prisma/prisma (@prisma/adapter-neon)
v7.2.0Compare Source
Today, we are excited to share the
7.2.0stable release 🎉🌟 Star this repo for notifications about new releases, bug fixes & features — or follow us on X!
Highlights
ORM
sqlcommenter-query-insightsplugin-urlparam fordb pull,db push,migrate dev-urlflag to key migrate commands to make connection configuration more flexible.prisma generateprisma generate) to proceed even when URLs are undefined.prisma initbased on the JS runtime (Bun vs others)prisma inittailor generated setup depending on whether the runtime is Bun or another JavaScript runtime.DataMapperErroraUserFacingErrorDataMapperErroris surfaced as a user-facing error for clearer, more actionable error reporting.22P02).prisma version --jsonemit JSON only to stdoutVS Code Extension
Open roles at Prisma
Interested in joining Prisma? We’re growing and have several exciting opportunities across the company for developers who are passionate about building with Prisma. Explore our open positions on our [Careers page](https://www.prisma.io/careers#current) and find the role that’s right for you.
Enterprise support
Thousands of teams use Prisma and many of them already tap into our Enterprise & Agency Support Program for hands-on help with everything from schema integrations and performance tuning to security and compliance.
With this program you also get priority issue triage and bug fixes, expert scalability advice, and custom training so that your Prisma-powered apps stay rock-solid at any scale. Learn more or join: https://prisma.io/enterprise.
v7.1.0Compare Source
Today, we are excited to share the
7.1.0stable release 🎉🌟 Star this repo for notifications about new releases, bug fixes & features — or follow us on X!
This release brings quality of life improvements and fixes various bugs.
Prisma ORM
#28735: pnpm monorepo issues with prisma client runtime utils
Resolves issues in pnpm monorepos where users would report TypeScript issues related to
@prisma/client-runtime-utils.#28769: implement sql commenter plugins for Prisma Client
This PR implements support for SQL commenter plugins to Prisma Client. The feature will allow users to add metadata to SQL queries as comments following the sqlcommenter format.
Here’s two related PRs that were also merged:
traceContextSQL commenter plugin#28737: added error message when constructing client without configs
This commit adds an additional error message when trying to create a new PrismaClient instance without any arguments.
Thanks to @xio84 for this community contribution!
#28820: mark
@opentelemetry/apias external in instrumentationEnsures
@opentelemetry/apiis treated as an external dependency rather than bundled.Since it is a peer dependency, this prevents applications from ending up with duplicate copies of the package.
#28694: allow
env()helper to accept interface-based genericsUpdates the
env()helper’s type definition so it works with interfaces as well as type aliases.This removes the previous constraint requiring an index signature and resolves TS2344 errors when using interface-based env types. Runtime behavior is unchanged.
Thanks to @SaubhagyaAnubhav for this community contribution!
Read Replicas extension
#53: Add support for Prisma 7
Users of the read-replicas extension can now use the extension in Prisma v7. You can update by installing:
For folks still on Prisma v6, install version
0.4.1:For more information, visit the repo
SQL comments
We're excited to announce SQL Comments support in Prisma 7.1.0! This new feature allows you to append metadata to your SQL queries as comments, making it easier to correlate queries with application context for improved observability, debugging, and tracing.
SQL comments follow the sqlcommenter format developed by Google, which is widely supported by database monitoring tools. With this feature, your SQL queries can include rich metadata:
Basic usage
Pass an array of SQL commenter plugins to the new
commentsoption when creating aPrismaClientinstance:Query tags
The
@prisma/sqlcommenter-query-tagspackage lets you add arbitrary tags to queries within an async context:Resulting SQL:
Use
withMergedQueryTagsto merge tags with outer scopes:Trace context
The
@prisma/sqlcommenter-trace-contextpackage adds W3C Trace Context (traceparent) headers for distributed tracing correlation:When tracing is enabled and the span is sampled:
Custom plugins
Create your own plugins to add custom metadata:
Framework integration
SQL comments work seamlessly with popular frameworks, e.g., Hono:
Additional framework examples for Express, Koa, Fastify, and NestJS are available in the documentation.
For complete documentation, see SQL Comments. We'd love to hear your feedback on this feature! Please open an issue on GitHub or join the discussion in our Discord community.
Open roles at Prisma
Interested in joining Prisma? We’re growing and have several exciting opportunities across the company for developers who are passionate about building with Prisma. Explore our open positions on our Careers page and find the role that’s right for you.
Enterprise support
Thousands of teams use Prisma and many of them already tap into our Enterprise & Agency Support Program for hands-on help with everything from schema integrations and performance tuning to security and compliance.
With this program you also get priority issue triage and bug fixes, expert scalability advice, and custom training so that your Prisma-powered apps stay rock-solid at any scale. Learn more or join: https://prisma.io/enterprise.
v7.0.1Compare Source
Today, we are issuing a 7.0.1 patch release focused on quality of life improvements, and bug fixes.
🛠 Fixes
Prisma Studio:
Prisma CLI
prisma migrate diff(via prisma/prisma-engines#5699)prisma db seedis run, but nomigrations.seedcommand is specified in the Prisma config file (via #28711)enginescheck inpackage.json, to let Node.js 25+ users adopt Prisma, although Node.js 25+ isn't considered stable yet (via #28600). Thanks @Sajito!Prisma Client
cockroachdbsupport inprisma-client-jsgenerator, after it was accidentally not shipped in Prisma 7.0.0 (via #28690)@prisma/better-sqlite3
better-sqlite3to^12.4.5, fixing #28624 (via #28625). Thank you @bhbs!v7.0.0Compare Source
Today, we are excited to share the
7.0.0stable release 🎉🌟 Star this repo for notifications about new releases, bug fixes & features — and follow us on X!
Highlights
Over the past year we focused on making it simpler and faster to build applications with Prisma, no matter what tools you use or where you deploy, with exceptional developer experience at it’s core. This release makes many features introduced over the past year as the new defaults moving forward.
Prisma ORM
ESM Prisma Client as the default
The Rust-free/ESM Prisma Client has been in the works for some time now, all the way back to v6.16.0, with early iterations being available for developers to adopt. Now with version 7.0, we’re making this the default for all new projects. With this, developers are able to get:
Adopting the new client is as simple as swapping the
prisma-client-jsprovider forprisma-clientin your mainschema.prisma:// schema.prisma generator client { - provider = "prisma-client-js" + provider = "prisma-client" }Prisma Client changes
In v7, we've moved to requiring users pass either an adapter or
accelerteUrlwhen creating a new instance ofPrismaClient.For Driver Adapters
For other databases:
We’ve also removed support for additional options when configuring your Prisma Client
new PrismaClient({ datasources: .. })support has been removednew PrismaClient({datasourceUrl: ..})support has been removednew PrismaClient()support has been removednew PrismaClient({})support has been removedFor Prisma Accelerate users:
Generated Client and types move out of
node_modulesWhen running
prisma generate, the generated Client runtime and project types will now require aoutputpath to be set in your project’s mainschema.prisma. We recommend that they be generated inside of your project’ssrcdirectory to ensure that your existing tools are able to consume them like any other piece of code you might have.Update your code to import
PrismaClientfrom this generated output:For developers who still need to stay on the
prisma-client-jsbut are using the newoutputoption, theres’s a new required package,@prisma/client-runtime-utils, which needs to be installed:Removal of implicit Prisma commands
In previous releases, Prisma would run
generateandseedin various situations:prisma generateprisma migratewould runprisma generateandprisma seedThis behaviour has been removed in favor of explicitly requiring commands to be run by users.
Removal of
prisma generateflagsFor
prisma generate, we’ve removed a few flags that were no longer needed:prisma generate --data-proxyprisma generate --accelerateprisma generate --no-engineprisma generate --allow-no-modelsRemoval of
prisma dbflagsFor
prisma db, we’ve removed the following flag:prisma db pull --local-d1This parameter no longer exists but equivalent functionality can be implemented by defining a config file with a connection string for the local D1 database. We provide a helper function listLocalDatabases in the D1 adapter to simplify the migration:
Removal of
prisma migrateflagsFor
prisma migrate diff, we’ve removed the following flags:prisma --[from/to]-schema-datamodel--[from/to]-schema. The usage is otherwise the same.prisma --[from/to]-url,prisma --[from/to]-schema-datasource--[from/to]-config-datasource. The user is expected to populate the datasource in the config file and use the new flag. We no longer support diffing two different URLs/datasources, since only one config can be used at a time.prisma --[from/to]-local-d1--[from/to]-config-datasource. The user is expected to populate the datasource in the config file and use the new flag with a minor complication due to the fact that it needs to reference the local D1 database. OurlistLocalDatabaseshelper function can be used for that, analogously to thedb pull --local-d1example above (where the user sets the datasource URL tofile://${listLocalDatabases().pop()})MongoDB support in Prisma 7
Currently, MongoDB is not supported in Prisma 7. For folks using MongoDB, please stay on Prisma v6. We aim to add support for MongoDB in a future release.
Driver Adapter naming updates
We’ve standardized our naming conventions for the various driver adapters internally. The following driver adapters have been updated:
PrismaBetterSQLite3⇒PrismaBetterSqlite3PrismaD1HTTP⇒PrismaD1HttpPrismaLibSQL⇒PrismaLibSqlPrismaNeonHTTP⇒PrismaNeonHttpSchema and config file updates
As part of a larger change in how the Prisma CLI reads your project configuration, we’ve updated what get’s set the schema, and what gets set in the
prisma.config.ts. Also as part of this release,prisma.config.tsis now required for projects looking to perform introspection and migration.Schema changes
datasource.urlis now configured in the config filedatasource.shadowDatabaseUrlis now configured in the config filedatasource.directUrlhas been made unnecessary and has removedgenerator.runtime=”react-native”has been removedFor early adopters of the config file, a few things have been removed with this release
engine: 'js'| 'classic'has been removedadapterhas been removedA brief before/after:
Explicit loading of environment variables
As part of the move to Prisma config, we’re no longer automatically loading environment variables when invoking the Prisma CLI. Instead, developers can utilize libraries like
dotenvto manage their environment variables and load them as they need. This means you can have dedicated local environment variables or ones set only for production. This removes any accidental loading of environment variables while giving developers full control.Removed support for
prismakeyword inpackage.jsonIn previous releases, users could configure their schema entry point and seed script in a
prismablock in thepackage.jsonof their project. With the move toprisma.config.ts, this no longer makes sense and has been removed. To migrate, use the Prisma config file instead:{ "name": "my-project", "version": "1.0.0", "prisma": { "schema": "./custom-path-to-schema/schema.prisma", "seed": "tsx ./prisma/seed.ts" } }Removed Client Engines:
We’ve removed the following client engines:
LibraryEngine(engineType = "library", the Node-API Client)BinaryEngine(engineType = "binary", the long-running executable binary)DataProxyEngineandAccelerateEngine(Accelerate uses a newRemoteExecutornow)ReactNativeEngineDeprecated metrics feature has been removed
We deprecated the previewFeature
metricssome time ago, and have removed it fully for version 7. If you need metrics related data available, you can use the underlying driver adapter itself, like the Pool metric from the Postgres driver.Miscellaneous
WeakRefin Cloudflare Workers. This will now avoid any unexpected memory leaks.--urlflag fromprisma db pullprisma introspectcommand./wasmto/edgeprisma-client-js/edge→ meant “for Prisma Accelerate”/wasm→ meant “for Edge JS runtimes (e.g., Cloudflare, Vercel Edge)”/edge→ means “for Edge JS runtimes (e.g., Cloudflare, Vercel Edge)”PRISMA_CLI_QUERY_ENGINE_TYPEPRISMA_CLIENT_ENGINE_TYPEPRISMA_QUERY_ENGINE_BINARYPRISMA_QUERY_ENGINE_LIBRARYPRISMA_GENERATE_SKIP_AUTOINSTALLPRISMA_SKIP_POSTINSTALL_GENERATEPRISMA_GENERATE_IN_POSTINSTALLPRISMA_GENERATE_DATAPROXYPRISMA_GENERATE_NO_ENGINEPRISMA_CLIENT_NO_RETRYPRISMA_MIGRATE_SKIP_GENERATEPRISMA_MIGRATE_SKIP_SEEDMapped enums
If you followed along on twitter, you will have seen that we teased a highly-request user feature was coming to v7.0. That highly-requested feature is…. mapped emuns! We now support the
@mapattribute for enum members, which can be used to set their expected runtime valuesNew Prisma Studio comes to the CLI
We launched a new version of Prisma Studio to our Console and VS Code extension a while back, but the Prisma CLI still shipped with the older version.
Now, with v7.0, we’ve updated the Prisma CLI to include the new Prisma Studio. Not only are you able to inspect your database, but you get rich visualization to help you understand connected relationships in your database. It’s customizable, much smaller, and can inspect remote database by passing a
--urlflag. This new version of Prisma Studio is not tied to the Prisma ORM, and establishes a new foundation for what comes next.Currently, the new studio only supports Postgres, MySQL, and SQLite, with support for other databases coming in a future release.
For issues related to Prisma Studio, please direct them to the Studio repo on github.
Prisma Postgres
Prisma Postgres is our managed Postgres service, designed with the same philosophy of great DX that has guided Prisma for close to a decade. It works great with serverless, it’s fast, and with simple pricing and a generous free tier. Here’s what’s new:
Connection Pooling Changes with Prisma Accelerate
With support for connection pooling being added natively to Prisma Postgres, Prisma Accelerate now serves as a dedicated caching layer. If you were using Accelerate for the connection pooling features, don’t worry! Your existing connection string via Accelerate will continue to work, and you can switch to the new connection pool when you’re ready.
Simplified connection flow
We've made connecting to Prisma Postgres even simpler. Now, when you go to connect to a database, you’ll get new options to enable connection pooling, or to enable Prisma Accelerate for caching. Below, you’ll get code snippets for getting things configured in your project right away.
Serverless driver
For those who want to connect to Prisma Postgres but are deploying to environments like Cloudflare Workers, we have a new version of the serverless client library to support these runtimes.
Check out the serverless driver docs for more details
Open roles at Prisma
Interested in joining Prisma? We’re growing and have several exciting opportunities across the company for developers who are passionate about building with Prisma. Explore our open positions on our Careers page and find the role that’s right for you.
Enterprise support
Thousands of teams use Prisma and many of them already tap into our Enterprise & Agency Support Program for hands-on help with everything from schema integrations and performance tuning to security and compliance.
With this program you also get priority issue triage and bug fixes, expert scalability advice, and custom training so that your Prisma-powered apps stay rock-solid at any scale. Learn more or join: https://prisma.io/enterprise.
v6.19.1Compare Source
Today, we are issuing a patch release for Prisma 6 that includes a fix for a diffing bug introduced in Prisma 6.13.1, which led to incorrectly reported empty diffs.
Changes
Configuration
📅 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 was generated by Mend Renovate. View the repository job log.