Skip to content

Commit 0e4e2ab

Browse files
fix(deps): update prisma monorepo to v7 (major) (#152)
> ℹ️ **Note** > > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@prisma/client](https://www.prisma.io) ([source](https://redirect.github.com/prisma/prisma/tree/HEAD/packages/client)) | [`^6.19.0` → `^7.7.0`](https://renovatebot.com/diffs/npm/@prisma%2fclient/6.19.0/7.7.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@prisma%2fclient/7.7.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@prisma%2fclient/6.19.0/7.7.0?slim=true) | | [prisma](https://www.prisma.io) ([source](https://redirect.github.com/prisma/prisma/tree/HEAD/packages/cli)) | [`^6.19.0` → `^7.7.0`](https://renovatebot.com/diffs/npm/prisma/6.19.0/7.7.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/prisma/7.7.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/prisma/6.19.0/7.7.0?slim=true) | --- ### Release Notes <details> <summary>prisma/prisma (@&#8203;prisma/client)</summary> ### [`v7.7.0`](https://redirect.github.com/prisma/prisma/compare/7.6.0...7.7.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.6.0...7.7.0) ### [`v7.6.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.6.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.5.0...7.6.0) Today, we are excited to share the `7.6.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** ### Highlights #### ORM ##### Features **CLI** - Added a `prisma postgres link` command that connects a local project to a Prisma Postgres database. This is the first command in a new `prisma postgres` command group for managing Prisma Postgres databases directly from the CLI. ([#&#8203;29352](https://redirect.github.com/prisma/prisma/issues/29352)) **Driver Adapters** - **[@&#8203;prisma/adapter-pg](https://redirect.github.com/prisma/adapter-pg)**: Added a `statementNameGenerator` option that accepts a custom prepared statement name generator to allow users to leverage `pg` statement caching ([#&#8203;29395](https://redirect.github.com/prisma/prisma/issues/29395)) - **[@&#8203;prisma/adapter-pg](https://redirect.github.com/prisma/adapter-pg)**: Added support for usage of connection strings directly in the constructor for improved ergonomics ([#&#8203;29287](https://redirect.github.com/prisma/prisma/issues/29287)) - **[@&#8203;prisma/adapter-mariadb](https://redirect.github.com/prisma/adapter-mariadb)**: Added a `useTextProtocol` option in the constructor to toggle between text and binary protocols ([#&#8203;29392](https://redirect.github.com/prisma/prisma/issues/29392)) ##### **Bug Fixes** **Prisma Client** - Disabled caching of `createMany` queries to avoid cache bloat and potential Node.js crashes in bulk operations ([#&#8203;29382](https://redirect.github.com/prisma/prisma/issues/29382)) - Made `NowGenerator` lazy to avoid synchronous `new Date()` calls, fixing Next.js "dynamic usage" errors in cached components ([#&#8203;28724](https://redirect.github.com/prisma/prisma/issues/28724)) - Fixed missing export of `Get<Model>GroupByPayload` type in the new `prisma-client` generator, making it accessible for TypeScript usage ([#&#8203;29346](https://redirect.github.com/prisma/prisma/issues/29346)) **CLI** - Added streaming parsing with automatic fallback to handle Prisma schemas that produce extremely large intermediate strings (>500MB) that hit V8's string limits ([#&#8203;29377](https://redirect.github.com/prisma/prisma/issues/29377)) **Driver Adapters** - **[@&#8203;prisma/adapter-pg](https://redirect.github.com/prisma/adapter-pg)**: Relaxed the `@types/pg` version constraint to `^8.16.0` for compatibility with newer PostgreSQL type definitions ([#&#8203;29390](https://redirect.github.com/prisma/prisma/issues/29390)) - **[@&#8203;prisma/adapter-pg](https://redirect.github.com/prisma/adapter-pg)**: Corrected error handling for `ColumnNotFound` errors to correctly extract column names from both quoted and unquoted PostgreSQL error messages ([#&#8203;29307](https://redirect.github.com/prisma/prisma/issues/29307)) - **[@&#8203;prisma/adapter-mariadb](https://redirect.github.com/prisma/adapter-mariadb)**: Modified the adapter to disable `mariadb` statement caching by default to address a reported leak ([#&#8203;29392](https://redirect.github.com/prisma/prisma/issues/29392)) #### Prisma Studio We’re continuing our work to improve Prisma Studio with more features being added. **Dark Mode** Need we say more? You’ve all asked for it, and it’s back. <https://github.com/user-attachments/assets/214149dd-5dd3-4295-9fa3-0da3f8d28197> **Copy as markdown** Now, you can copy one or more rows as either CSV or Markdown <img width="1888" height="672" alt="CleanShot 2026-03-11 at 16 04 09@&#8203;2x" src="https://github.com/user-attachments/assets/402b4c77-08ac-4c2d-b61a-0135eb42a9af" /> **Multi-cell editing** This is big one, something that folks have been asking for. Now, it’s possible to edit multiple cells while inspecting your database. If you make any changes, you’ll be prompted to either save or discard them. This makes manually adding new rows much easier to accomplish. **Back relations** If your data references another table, Prisma Studio now links to the related records, making it easy to inspect them. This makes traversing your database much simpler. <https://github.com/user-attachments/assets/4977a926-413b-495f-b651-b7554eefea04> **Generative SQL with AI** If you need to inspect your database, instead of manually writing the SQL you may need, you can use natural language and AI to generate the appropriate SQL statements. <https://github.com/user-attachments/assets/e57c0afb-c3ed-471b-b55a-42395a134863> #### 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.5.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.5.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.4.2...7.5.0) Today, we are excited to share the `7.5.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** ##### Highlights ##### ORM ##### Features - **Added support for nested transaction rollbacks via savepoints (**[#&#8203;21678](https://redirect.github.com/prisma/prisma/pull/21678)) Adds support for **nested transaction rollback behavior** for SQL databases: if an outer transaction fails, the inner nested transaction is rolled back as well. Implements this by tracking **transaction ID + nesting depth** so Prisma can reuse an existing open transaction in the underlying engine, and it also enables using **`$transaction` from an interactive transaction client**. ##### Bug fixes **Driver Adapters** - Made the `adapter-mariadb` use the binary MySQL protocol to fix an issue with lossy number conversions ([#&#8203;29285](https://redirect.github.com/prisma/prisma/pull/29285)) - Made `@types/pg` a direct dependency of `adapter-pg` for better TypeScript experience out-of-the-box ([#&#8203;29277](https://redirect.github.com/prisma/prisma/pull/29277)) **Prisma Client** - Resolved `Prisma.DbNull` serializing as empty object in some bundled environments like Next.js ([#&#8203;29286](https://redirect.github.com/prisma/prisma/pull/29286)) - Fixed DateTime fields returning `Invalid Date` with `unixepoch-ms` timestamps in some cases ([#&#8203;29274](https://redirect.github.com/prisma/prisma/pull/29274)) - Fixed a cursor-based pagination issue with `@db.Date` columns ([#&#8203;29327](https://redirect.github.com/prisma/prisma/pull/29327)) **Schema Engine** - Manual partial indexes are now preserved when `partialIndexes` preview feature is disabled, preventing unnecessary drops and additions in migrations ([#&#8203;5790](https://redirect.github.com/prisma/prisma-engines/pull/5790), [#&#8203;5795](https://redirect.github.com/prisma/prisma-engines/pull/5795)) - Enhanced partial index predicate comparison to handle quoted vs unquoted identifiers correctly, eliminating needless recreate cycles ([#&#8203;5788](https://redirect.github.com/prisma/prisma-engines/pull/5788)) - Excluded partial unique indexes from DMMF `uniqueFields` and `uniqueIndexes` to prevent incorrect `findUnique` input type generation ([#&#8203;5792](https://redirect.github.com/prisma/prisma-engines/pull/5792)) ##### Studio With the launch of Prisma ORM v7, we also introduced a rebuilt version of Prisma Studio. With the feedback we’ve gathered since the release, we’ve added some high requested features to help make Studio a better experience. **Multi-cell Selection & Full Table Search** This release brings the ability to select multiple cells when viewing your database. In addition to being able to select multiple cells, you can also search across your database. You can search for a specific table or for specific cells within that table. ![Adobe Express - CleanShot 2026-03-04 at 21 15 08-2](https://redirect.github.com/user-attachments/assets/e3d2aa3d-ae03-47f0-a5d6-3530675864f7) **More intuitive filtering** Filtering is now easier to use, and includes an option for raw SQL filters. ![CleanShot 2026-03-11 at 11 26 35](https://redirect.github.com/user-attachments/assets/ba20f670-3770-4dcf-869f-673519bd847c) And if you are using Studio in Console, you can use ai generated filters: ![CleanShot 2026-03-11 at 11 28 18](https://redirect.github.com/user-attachments/assets/4bd1c328-2429-4fb1-948d-d8d841900f22) **Cmd+k Command Palette** You can now use the keyboard to perform most actions in Studio with the new cmd+k command palette ![CleanShot 2026-03-11 at 11 30 35](https://redirect.github.com/user-attachments/assets/691b7a6e-c677-480c-addc-db42fc2aa9a5) **Run raw SQL queries** Another feature we’ve included in Prisma Studio is the ability to run raw SQL queries against your data. There’s a new “SQL” tab in the sidebar that will bring you to page where you can perform any queries against your data. Below, we’re getting all the rows in the “Todo” table. ![Adobe Express - Screen Recording 2026-03-10 at 2 30 52 PM-2](https://redirect.github.com/user-attachments/assets/9f3cf91f-23d3-49f1-9cd7-661752186432) ##### 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)]\(<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.4.2`](https://redirect.github.com/prisma/prisma/releases/tag/7.4.2) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.4.1...7.4.2) Today, we are issuing a 7.4.2 patch release focused on bug fixes and quality improvements. ##### 🛠 Fixes **Prisma Client** - Fix a case-insensitive `IN` and `NOT IN` filter regression ([#&#8203;29243](https://redirect.github.com/prisma/prisma/pull/29243)) - Fix a query plan mutation issue that resulted in broken cursor queries ([#&#8203;29262](https://redirect.github.com/prisma/prisma/pull/29262)) - Fix an array parameter wrapping issue in push operations ([prisma/prisma-engines#5784](https://redirect.github.com/prisma/prisma-engines/pull/5784)) - Fix `Uint8Array` serialization in nested JSON fields ([#&#8203;29268](https://redirect.github.com/prisma/prisma/pull/29268)) - Fix an issue with MySQL joins that relied on non-strict equality ([#&#8203;29251](https://redirect.github.com/prisma/prisma/pull/29251)) **Driver Adapters** - **[@&#8203;prisma/adapter-mariadb](https://redirect.github.com/prisma/adapter-mariadb)**: Update text column detection to check for a binary collation ([#&#8203;29238](https://redirect.github.com/prisma/prisma/pull/29238)) - **[@&#8203;prisma/adapter-mariadb](https://redirect.github.com/prisma/adapter-mariadb)**: Correct `relationJoins` compatibility check for MariaDB 8.x versions ([#&#8203;29246](https://redirect.github.com/prisma/prisma/pull/29246)) **Schema Engine** - Fix partial index predicate comparison on PostgreSQL and MSSQL ([prisma/prisma-engines#5780](https://redirect.github.com/prisma/prisma-engines/pull/5780)) ##### 🙏 Huge thanks to our community Many of the fixes in this release were contributed by our amazing community members. We're grateful for your continued support and contributions that help make Prisma better for everyone! ### [`v7.4.1`](https://redirect.github.com/prisma/prisma/releases/tag/7.4.1) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.4.0...7.4.1) Today, we are issuing a 7.4.1 patch release focused on bug fixes and quality improvements. #### 🛠 Fixes **Prisma Client** - Fix cursor-based pagination regression with parameterised values ([#&#8203;29184](https://redirect.github.com/prisma/prisma/pull/29184)) - Preserve `Prisma.skip` through query extension argument cloning ([#&#8203;29198](https://redirect.github.com/prisma/prisma/pull/29198)) - Enable batching of multiple queries inside interactive transactions ([#&#8203;25571](https://redirect.github.com/prisma/prisma/pull/25571)) - Add missing JSON value deserialization for JSONB parameter fields ([#&#8203;29182](https://redirect.github.com/prisma/prisma/pull/29182)) - Apply result extensions correctly for nested and fluent relations ([#&#8203;29218](https://redirect.github.com/prisma/prisma/pull/29218)) - Allow missing config datasource URL and validate only when needed ([prisma/prisma-engines#5777](https://redirect.github.com/prisma/prisma-engines/pull/5777)) **Driver Adapters** - **[@&#8203;prisma/adapter-ppg](https://redirect.github.com/prisma/adapter-ppg)**: Handle null values in type parsers for nullable columns ([#&#8203;29192](https://redirect.github.com/prisma/prisma/pull/29192)) **Prisma Schema Language** - Support `where` argument on field-level `@unique` for partial indexes ([prisma/prisma-engines#5774](https://redirect.github.com/prisma/prisma-engines/pull/5774)) - Add object expression and object member support to schema reformatter ([prisma/prisma-engines#5776](https://redirect.github.com/prisma/prisma-engines/pull/5776)) #### 🙏 Huge thanks to our community Many of the fixes in this release were contributed by our amazing community members. We're grateful for your continued support and contributions that help make Prisma better for everyone! ### [`v7.4.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.4.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.3.0...7.4.0) Today, we are excited to share the `7.4.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** ##### Highlights ##### ORM ##### Caching in Prisma Client Today’s release is a big one, as we introduce a new caching layer into Prisma ORM. But why the need for a caching layer? In Prisma 7, the query compiler runs as a WebAssembly module directly on the JavaScript main thread. While this simplified the architecture by eliminating the separate engine process, it introduced a trade-off: every query now synchronously blocks the event loop during compilation. For individual queries, compilation takes between 0.1ms and 1ms, which is barely noticeable in isolation. But under high concurrency this overhead adds up and creates event loop contention that affects overall application throughput. For instance, say we have a query that is run over and over, but is a similar shape: ```tsx // These two queries have the same shape: const alice = await prisma.user.findUnique({ where: { email: 'alice@prisma.io' } }) const bob = await prisma.user.findUnique({ where: { email: 'bob@prisma.io' } }) ``` Prior to v7.4.0, this would be reevaluated ever time the query is run. Now, Prisma Client will extract the user-provided values and replaces them with typed placeholders, producing a normalized query shape: ``` prisma.user.findUnique({ where: { email: %1 } }) // cache key ↑ %1 = 'alice@prisma.io' (or 'bob@prisma.io') ``` This normalized shape is used as a cache key. On the first call, the query is compiled as usual and the resulting plan is stored in an LRU cache. On every subsequent call with the same query shape, regardless of the actual values, the cached plan is reused instantly without invoking the compiler. We have more details on the impact of this change and some deep dives into Prisma architecture in an upcoming blog post! ##### Partial Indexes (Filtered Indexes) Support We're excited to announce **Partial Indexes** support in Prisma! This powerful community-contributed feature allows you to create indexes that only include rows matching specific conditions, significantly reducing index size and improving query performance. Partial indexes are available behind the `partialIndexes` preview feature for PostgreSQL, SQLite, SQL Server, and CockroachDB, with full migration and introspection support. **Basic usage** Enable the preview feature in your schema: ```groovy generator client { provider = "prisma-client-js" previewFeatures = ["partialIndexes"] } ``` **Raw SQL syntax** For maximum flexibility, use the `raw()` function with database-specific predicates: ```groovy model User { id Int @&#8203;id email String status String @&#8203;@&#8203;unique([email], where: raw("status = 'active'")) @&#8203;@&#8203;index([email], where: raw("deletedAt IS NULL")) } ``` **Type-safe object syntax** For better type safety, use the object literal syntax for simple conditions: ```groovy model Post { id Int @&#8203;id title String published Boolean @&#8203;@&#8203;index([title], where: { published: true }) @&#8203;@&#8203;unique([title], where: { published: { not: false } }) } ``` ##### Bug Fixes Most of these fixes are **community contributions** - thank you to our amazing contributors! - [**prisma/prisma-engines#5767**](https://redirect.github.com/prisma/prisma-engines/pull/5767): Fixed an issue with PostgreSQL migration scripts that prevented usage of `CREATE INDEX CONCURRENTLY` in migrations - [**prisma/prisma-engines#5752**](https://redirect.github.com/prisma/prisma-engines/pull/5752): Fixed BigInt precision loss in JSON aggregation for MySQL and CockroachDB by casting BigInt values to text (from community member [polaz](https://redirect.github.com/polaz)) - [**prisma/prisma-engines#5750**](https://redirect.github.com/prisma/prisma-engines/pull/5750): Fixed connection failures with non-ASCII database names by properly URL-decoding database names in connection strings - [**#&#8203;29155**](https://redirect.github.com/prisma/prisma/pull/29155): Fixed silent transaction commit errors in PlanetScale adapter by ensuring COMMIT failures are properly propagated - [**#&#8203;29141**](https://redirect.github.com/prisma/prisma/pull/29141): Resolved race condition errors (EREQINPROG) in SQL Server adapter by serializing commit/rollback operations using mutex synchronization - [**#&#8203;29158**](https://redirect.github.com/prisma/prisma/pull/29158): Fixed MSSQL connection string parsing to properly handle curly brace escaping for passwords containing special characters ##### 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.3.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.3.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.2.0...7.3.0) Today, we are excited to share the `7.3.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** ##### ORM - [#&#8203;28976](https://redirect.github.com/prisma/prisma/pull/28976): Fast and Small Query Compilers We've been working on various performance-related bugs since the initial ORM 7.0 release. With 7.3.0, we're introducing a new `compilerBuild` option for the client generator block in `schema.prisma` with two options: `fast` and `small`. This allows you to swap the underlying Query Compiler engine based on your selection, one built for speed (with an increase in size), and one built for size (with the trade off for speed). By default, the `fast` mode is used, but this can be set by the user: ```groovy generator client { provider = "prisma-client" output = "../src/generated/prisma" compilerBuild = "fast" // "fast" | "small" } ``` We still have more in progress for performance, but this new `compilerBuild` option is our first step toward addressing your concerns! - [#&#8203;29005](https://redirect.github.com/prisma/prisma/pull/29005): Bypass the Query Compiler for Raw Queries Raw queries (`$executeRaw`, `$queryRaw`) can now skip going through the query compiler and query interpreter infrastructure. They can be sent directly to the driver adapter, removing additional overhead. - [#&#8203;28965](https://redirect.github.com/prisma/prisma/pull/28965): Update MSSQL to v12.2.0 This community PR updates the `@prisma/adapter-mssql` to use MSSQL v12.2.0. Thanks [Jay-Lokhande](https://redirect.github.com/Jay-Lokhande)! - [#&#8203;29001](https://redirect.github.com/prisma/prisma/pull/29001): Pin better-sqlite3 version to avoid SQLite bug An underlying bug in SQLite 3.51.0 has affected the `better-sqlite3` adapter. We’ve bumped the version that powers `@prisma/better-sqlite3` and have pinned the version to prevent any unexpected issues. If you are using `@prisma/better-sqlite3` , please upgrade to v7.3.0. - [#&#8203;29002](https://redirect.github.com/prisma/prisma/pull/29002): Revert `@map` enums to v6.19.0 behavior In the initial release of v7.0, we made a change with Mapped Enums where the generated enum would get its value from the value passed to the `@map` function. This was a breaking change from v6 that caused issues for many users. We have reverted this change for the time being, as many different diverging approaches have emerged from the community discussion. - [prisma-engines#5745](https://redirect.github.com/prisma/prisma-engines/pull/5745): Cast BigInt to text in JSON aggregation When using `relationJoins` with BigInt fields in Prisma 7, JavaScript's `JSON.parse` loses precision for integers larger than `Number.MAX_SAFE_INTEGER` (2^53 - 1). This happens because PostgreSQL's `JSONB_BUILD_OBJECT` returns BigInt values as JSON numbers, which JavaScript cannot represent precisely. ``` // Original BigInt ID: 312590077454712834 // After JSON.parse: 312590077454712830 (corrupted!) ``` This PR cast BigInt columns to `::text` inside `JSONB_BUILD_OBJECT` calls, similar to how `MONEY` is already cast to `::numeric`. ``` -- Before JSONB_BUILD_OBJECT('id', "id") -- After JSONB_BUILD_OBJECT('id', "id"::text) ``` This ensures BigInt values are returned as JSON strings, preserving full precision when parsed in JavaScript. ##### 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)]\(<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.2.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.2.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.1.0...7.2.0) Today, we are excited to share the `7.2.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** #### Highlights #### ORM - [#&#8203;28830](https://redirect.github.com/prisma/prisma/pull/28830): feat: add `sqlcommenter-query-insights` plugin - Adds a new SQL commenter plugin to support query insights metadata. - [#&#8203;28860](https://redirect.github.com/prisma/prisma/pull/28860): feat(migrate): add `-url` param for `db pull`, `db push`, `migrate dev` - Adds a `-url` flag to key migrate commands to make connection configuration more flexible. - [#&#8203;28895](https://redirect.github.com/prisma/prisma/pull/28895): feat(config): allow undefined URLs in e.g. `prisma generate` - Allows certain workflows (such as `prisma generate`) to proceed even when URLs are undefined. - [#&#8203;28903](https://redirect.github.com/prisma/prisma/pull/28903): feat(cli): customize `prisma init` based on the JS runtime (Bun vs others) - Makes `prisma init` tailor generated setup depending on whether the runtime is Bun or another JavaScript runtime. - [#&#8203;28846](https://redirect.github.com/prisma/prisma/pull/28846): fix(client-engine-runtime): make `DataMapperError` a `UserFacingError` - Ensures `DataMapperError` is surfaced as a user-facing error for clearer, more actionable error reporting. - [#&#8203;28849](https://redirect.github.com/prisma/prisma/pull/28849): fix(adapter-{pg,neon,ppg}): handle 22P02 error in Postgres - Improves Postgres adapter error handling for invalid-text-representation errors (`22P02`). - [#&#8203;28913](https://redirect.github.com/prisma/prisma/pull/28913): fix: fix byte upserts by removing legacy byte array representation - Fixes byte upsert behavior by removing a legacy byte-array representation path. - [#&#8203;28535](https://redirect.github.com/prisma/prisma/pull/28535): fix(client,internals,migrate,generator-helper): handle multibyte UTF-8 characters split across chunk boundaries in byline - Prevents issues when multibyte UTF-8 characters are split across chunk boundaries during line processing. - [#&#8203;28911](https://redirect.github.com/prisma/prisma/pull/28911): fix(cli): make `prisma version --json` emit JSON only to stdout - Ensures machine-readable JSON output is emitted cleanly to stdout without extra noise. #### VS Code Extension - [#&#8203;1950](https://redirect.github.com/prisma/language-tools/pull/1950): fix: TML-1670 studio connections - Resolves issues related to Studio connections, improving reliability for VS Code or language-server integrations. #### 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)]\(<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.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.1.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.0.1...7.1.0) Today, we are excited to share the `7.1.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** This release brings quality of life improvements and fixes various bugs. #### Prisma ORM - [#&#8203;28735](https://redirect.github.com/prisma/prisma/pull/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`. - [#&#8203;28769](https://redirect.github.com/prisma/prisma/pull/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](https://google.github.io/sqlcommenter/). Here’s two related PRs that were also merged: - [#&#8203;28796](https://redirect.github.com/prisma/prisma/pull/28796): **implement query tags for SQL commenter plugin** - [#&#8203;28802](https://redirect.github.com/prisma/prisma/pull/28802): **add `traceContext` SQL commenter plugin** - [#&#8203;28737](https://redirect.github.com/prisma/prisma/pull/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 [@&#8203;xio84](https://redirect.github.com/xio84) for this community contribution! - [#&#8203;28820](https://redirect.github.com/prisma/prisma/pull/28820): **mark `@opentelemetry/api` as external in instrumentation** Ensures `@opentelemetry/api` is 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. - [#&#8203;28694](https://redirect.github.com/prisma/prisma/pull/28694): **allow `env()` helper to accept interface-based generics** Updates 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 [@&#8203;SaubhagyaAnubhav](https://redirect.github.com/SaubhagyaAnubhav) for this community contribution! #### Read Replicas extension - [#&#8203;53](https://redirect.github.com/prisma/extension-read-replicas/pull/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: ```bash npm install @&#8203;prisma/extension-read-replicas@latest ``` For folks still on Prisma v6, install version `0.4.1`: ```bash npm install @&#8203;prisma/extension-read-replicas@0.4.1 ``` For more information, [visit the repo](https://redirect.github.com/prisma/extension-read-replicas) #### 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](https://google.github.io/sqlcommenter/) developed by Google, which is widely supported by database monitoring tools. With this feature, your SQL queries can include rich metadata: ```sql SELECT "id", "name" FROM "User" /*application='my-app',traceparent='00-abc123...-01'*/ ``` ##### Basic usage Pass an array of SQL commenter plugins to the new `comments` option when creating a `PrismaClient` instance: ```tsx import { PrismaClient } from './generated/prisma/client'; import { PrismaPg } from '@&#8203;prisma/adapter-pg'; import { queryTags } from '@&#8203;prisma/sqlcommenter-query-tags'; import { traceContext } from '@&#8203;prisma/sqlcommenter-trace-context'; const adapter = new PrismaPg({ connectionString: `${process.env.DATABASE_URL}`, }); const prisma = new PrismaClient({ adapter, comments: [queryTags(), traceContext()], }); ``` ##### Query tags The `@prisma/sqlcommenter-query-tags` package lets you add arbitrary tags to queries within an async context: ```tsx import { queryTags, withQueryTags } from '@&#8203;prisma/sqlcommenter-query-tags'; const prisma = new PrismaClient({ adapter, comments: [queryTags()], }); // Wrap your queries to add tags const users = await withQueryTags( { route: '/api/users', requestId: 'abc-123' }, () => prisma.user.findMany(), ); ``` Resulting SQL: ```sql SELECT ... FROM "User" /*requestId='abc-123',route='/api/users'*/ ``` Use `withMergedQueryTags` to merge tags with outer scopes: ```tsx import { withQueryTags, withMergedQueryTags, } from '@&#8203;prisma/sqlcommenter-query-tags'; await withQueryTags({ requestId: 'req-123', source: 'api' }, async () => { await withMergedQueryTags( { userId: 'user-456', source: 'handler' }, async () => { // Queries here have: requestId='req-123', userId='user-456', source='handler' await prisma.user.findMany(); }, ); }); ``` ##### Trace context The `@prisma/sqlcommenter-trace-context` package adds W3C Trace Context (`traceparent`) headers for distributed tracing correlation: ```tsx import { traceContext } from '@&#8203;prisma/sqlcommenter-trace-context'; const prisma = new PrismaClient({ adapter, comments: [traceContext()], }); ``` When tracing is enabled and the span is sampled: ```sql SELECT * FROM "User" /*traceparent='00-0af7651916cd43dd8448eb211c80319c-b9c7c989f97918e1-01'*/ ``` > Note: Requires [@&#8203;prisma/instrumentation](https://redirect.github.com/prisma/instrumentation) to be configured. The traceparent is only added when tracing is active and the span is sampled. ##### Custom plugins Create your own plugins to add custom metadata: ```tsx import type { SqlCommenterPlugin } from '@&#8203;prisma/sqlcommenter'; const applicationTags: SqlCommenterPlugin = (context) => ({ application: 'my-service', environment: process.env.NODE_ENV ?? 'development', operation: context.query.action, model: context.query.modelName, }); const prisma = new PrismaClient({ adapter, comments: [applicationTags], }); ``` ##### Framework integration SQL comments work seamlessly with popular frameworks, e.g., **Hono**: ```tsx import { createMiddleware } from 'hono/factory'; import { withQueryTags } from '@&#8203;prisma/sqlcommenter-query-tags'; app.use( createMiddleware(async (c, next) => { await withQueryTags( { route: c.req.path, method: c.req.method, requestId: c.req.header('x-request-id') ?? crypto.randomUUID(), }, () => next(), ); }), ); ``` Additional framework examples for **Express**, **Koa**, **Fastify**, and **NestJS** are available in the documentation. For complete documentation, see [SQL Comments](https://www.prisma.io/docs/orm/prisma-client/observability-and-logging/sql-comments). We'd love to hear your feedback on this feature! Please open an issue on [GitHub](https://redirect.github.com/prisma/prisma) or join the discussion in our [Discord community](https://pris.ly/discord). #### 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.0.1`](https://redirect.github.com/prisma/prisma/releases/tag/7.0.1) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.0.0...7.0.1) Today, we are issuing a 7.0.1 patch release focused on quality of life improvements, and bug fixes. ##### 🛠 Fixes - **Prisma Studio**: - Support Deno >= 1.4 <2.2 and Bun >= 1 (via [#&#8203;28583](https://redirect.github.com/prisma/prisma/pull/28583)) - Fix collisions between user and internal Studio columns when querying (via [#&#8203;28677](https://redirect.github.com/prisma/prisma/pull/28677)) - Warn when SQLite file doesn't exist (via <https://redirect.github.com/prisma/prisma/pull/28711/commits/c33a1ea9e5a94e6a5c876bc4567915cc5f354658>) - Fix [prisma/studio#1363](https://redirect.github.com/prisma/studio/issues/1363) (via <https://redirect.github.com/prisma/prisma/pull/28711/commits/07224d4651d043f4b08735eeaa144aa9d75f9fe3>) - Sort tables alphabetically (via [#&#8203;28702](https://redirect.github.com/prisma/prisma/pull/28702)) - **Prisma CLI** - Fix potential vulnerabilities in installed dependencies (via [#&#8203;28592](https://redirect.github.com/prisma/prisma/pull/28592)) - Fix [#&#8203;28240](https://redirect.github.com/prisma/prisma/issues/28240), an exit code regression affecting `prisma migrate diff` (via [prisma/prisma-engines#5699](https://redirect.github.com/prisma/prisma-engines/pull/5699)) - Show informative message when `prisma db seed` is run, but no `migrations.seed` command is specified in the Prisma config file (via [#&#8203;28711](https://redirect.github.com/prisma/prisma/pull/28711)) - Relax `engines` check in `package.json`, to let Node.js 25+ users adopt Prisma, although Node.js 25+ isn't considered stable yet (via [#&#8203;28600](https://redirect.github.com/prisma/prisma/pull/28600)). Thanks [@&#8203;Sajito](https://redirect.github.com/Sajito)! - **Prisma Client** - Restore `cockroachdb` support in `prisma-client-js` generator, after it was accidentally not shipped in Prisma 7.0.0 (via [#&#8203;28690](https://redirect.github.com/prisma/prisma/pull/28690)) - **[@&#8203;prisma/better-sqlite3](https://redirect.github.com/prisma/better-sqlite3)** - Bump underlying version of `better-sqlite3` to `^12.4.5`, fixing [#&#8203;28624](https://redirect.github.com/prisma/prisma/issues/28624) (via [#&#8203;28625](https://redirect.github.com/prisma/prisma/pull/28625)). Thank you [@&#8203;bhbs](https://redirect.github.com/bhbs)! ### [`v7.0.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.0.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/6.19.3...7.0.0) Today, we are excited to share the `7.0.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — and [follow us on X](https://pris.ly/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 ##### Rust-free Prisma Client as the default The Rust-free Prisma Client has been in the works for some time now, all the way [back to v6.16.0](https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-6), 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: - \~90% smaller bundle sizes - Up to 3x faster queries - ESM-first Prisma Client - Significantly simpler deployments Adopting the new Rust-free client is as simple as swapping the `prisma-client-js` provider for `prisma-client` in your main `schema.prisma` : ```diff // schema.prisma generator client { - provider = "prisma-client-js" + provider = "prisma-client" } ``` ##### Generated Client and types move out of `node_modules` When running `prisma generate`, the generated Client runtime and project types will now **require** a `output` path to be set in your project’s main `schema.prisma`. We recommend that they be generated inside of your project’s `src` directory to ensure that your existing tools are able to consume them like any other piece of code you might have. ```groovy // schema.prisma generator client { provider = "prisma-client" // Generate my Client and Project types output = "../src/generated/prisma" } ``` Update your code to import `PrismaClient` from this generated output: ```tsx // Import from the generated prisma client import { PrismaClient } from './generated/prisma/client'; ``` For developers who still need to stay on the `prisma-client-js` but are using the new `output` option, theres’s a new required package, `@prisma/client-runtime-utils` , which needs to be installed: ```bash # for prisma-client-js users only npm install @&#8203;prisma/client-runtime-utils ``` ##### `prisma generate` changes and post-install hook removal For `prisma generate` , we’ve removed a few flags that were no longer needed: - `prisma generate --data-proxy` - `prisma generate --accelerate` - `prisma generate --no-engine` - `prisma generate --allow-no-models` In previous releases, there was a post-install hook that we utilized to automatically generate your project’s Client and types. With modern package managers like pnpm, this actually has introduced more problems than it has solved. So we’ve removed this post-install hook and now require developers to explicitly call `prisma generate` . As a part of those changes, we’ve also removed the implicit run of `prisma db seed` in-between `migrate` commands. ##### Prisma Client As part of the move to a Rust-free Prisma Client, we moved away from embedding the drivers of the databases that we support. Now developers explicitly provide the driver adapters they need for their project, right in their source code. For PostgresSQL, simply install the `@prisma/adapter-pg` to your project, configure the connection string, and pass that the Prisma Client creation: ```tsx // Import from the generated prisma client import { PrismaClient } from './generated/prisma/client'; // Driver Adapter for Postgres import { PrismaPg } from '@&#8203;prisma/adapter-pg'; const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL!, }); export const prisma = new PrismaClient({ adapter }); ``` For other databases: ```tsx // If using SQLite import { PrismaBetterSqlite3 } from '@&#8203;prisma/adapter-better-sqlite3'; const adapter = new PrismaBetterSqlite3({ url: process.env.DATABASE_URL || 'file:./dev.db' }) // If using MySql import { PrismaMariaDb } from '@&#8203;prisma/adapter-mariadb'; const adapter = new PrismaMariaDb({ host: "localhost", port: 3306, connectionLimit: 5 }); ``` We’ve also removed support for additional options when configuring your Prisma Client - `new PrismaClient({ datasources: .. })` support has been removed - `new PrismaClient({datasourceUrl: ..})` support has been removed ##### Driver Adapter naming updates We’ve standardized our naming conventions for the various driver adapters internally. The following driver adapters have been updated: - `PrismaBetterSQLite3` ⇒ `PrismaBetterSqlite3` - `PrismaD1HTTP` ⇒ `PrismaD1Http` - `PrismaLibSQL` ⇒ `PrismaLibSql` - `PrismaNeonHTTP` ⇒ `PrismaNeonHttp` ##### Schema 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.ts` is now required for projects looking to perform introspection. **Schema changes** - `datasource.url` is now configured in the config file - `datasource.shadowDatabaseUrl` is now configured in the config file - `datasource.directUrl` has been made unnecessary and has removed - `generator.runtime=”react-native”` has been removed For early adopters of the config file, a few things have been removed with this release - `engine: 'js'| 'classic'` has been removed - `adapter` has been removed A brief before/after: ```groovy // schema.prisma datasource db { provider = "postgresql" url = ".." directUrl = ".." shadowDatabaseUrl = ".." } ``` ```tsx // ./prisma.config.ts export default defineConfig({ datasource: { url: '..', shadowDatabaseUrl: '..', } }) ``` ##### 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 `dotenv` to 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 `prisma` keyword in `package.json` In previous releases, users could configure their schema entry point and seed script in a `prisma` block in the `package.json` of their project. With the move to `prisma.config.ts`, this no longer makes sense and has been removed. To migrate, use the Prisma config file instead: ```json { "name": "my-project", "version": "1.0.0", "prisma": { "schema": "./custom-path-to-schema/schema.prisma", "seed": "tsx ./prisma/seed.ts" } } ``` ```tsx import 'dotenv/config' import { defineConfig, env } from "prisma/config"; export default defineConfig({ schema: "prisma/schema.prisma", migrations: { seed: "tsx prisma/seed.ts" }, datasource: {...}, }); ``` ##### 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) - `DataProxyEngine` and `AccelerateEngine` (Accelerate uses a new `RemoteExecutor` now) - `ReactNativeEngine` ##### Deprecated metrics feature has been removed We deprecated the previewFeature `metrics` some 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 - [#&#8203;28493](https://redirect.github.com/prisma/prisma/pull/28493): Stop shimming `WeakRef` in Cloudflare Workers. This will now avoid any unexpected memory leaks. - [#&#8203;28297](https://redirect.github.com/prisma/prisma/pull/28297): Remove hardcoded URL validation. Users are now required to make sure they don’t include sensitive information in their config files. - [#&#8203;28273](https://redirect.github.com/prisma/prisma/pull/28273): Removed Prisma v1 detection - [#&#8203;28343](https://redirect.github.com/prisma/prisma/pull/28343): Remove undocumented `--url` flag from `prisma db pull` - [#&#8203;28286](https://redirect.github.com/prisma/prisma/pull/28286): Remove deprecated `prisma introspect` command. - [#&#8203;28480](https://redirect.github.com/prisma/prisma/pull/28480): Rename `/wasm` to `/edge` - This change only affects `prisma-client-js` - Before: - `/edge` → meant “for Prisma Accelerate” - `/wasm` → meant “for Edge JS runtimes (e.g., Cloudflare, Vercel Edge)” - After: - `/edge` → means “for Edge JS runtimes (e.g., Cloudflare, Vercel Edge)” - The following Prisma-specific environment variables have been removed - `PRISMA_CLI_QUERY_ENGINE_TYPE` - `PRISMA_CLIENT_ENGINE_TYPE` - `PRISMA_QUERY_ENGINE_BINARY` - `PRISMA_QUERY_ENGINE_LIBRARY` - `PRISMA_GENERATE_SKIP_AUTOINSTALL` - `PRISMA_SKIP_POSTINSTALL_GENERATE` - `PRISMA_GENERATE_IN_POSTINSTALL` - `PRISMA_GENERATE_DATAPROXY` - `PRISMA_GENERATE_NO_ENGINE` - `PRISMA_CLIENT_NO_RETRY` - `PRISMA_MIGRATE_SKIP_GENERATE` - `PRISMA_MIGRATE_SKIP_SEED` ##### Mapped enums If [you followed along on twitter](https://x.com/prisma/status/1988970132690071600), 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 `@map` attribute for enum members, which can be used to set their expected runtime values ```groovy enum PaymentProvider { MixplatSMS @&#8203;map("mixplat/sms") InternalToken @&#8203;map("internal/token") Offline @&#8203;map("offline") @&#8203;@&#8203;map("payment_provider") } ``` ```tsx export const PaymentProvider: { MixplatSMS: 'mixplat/sms' InternalToken: 'internal/token' Offline: 'offline' } ``` ##### Prisma Accelerate changes We’ve changed how to configure Prisma ORM to use Prisma Accelerate. In conjunction with some more Prisma Postgres updates (more on that later), you now use the new `accelerateUrl` option when instantiating the Prisma Client. ```tsx import { PrismaClient } from "./generated/prisma/client" import { withAccelerate } from "@&#8203;prisma/extension-accelerate" const prisma = new PrismaClient({ accelerateUrl: process.env.DATABASE_URL, }).$extends(withAccelerate()) ``` #### New 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 `--url` flag. This new version of Prisma Studio is not tied to the Prisma ORM, and establishes a new foundation for what comes next. ![ScreenRecording2025-11-18at7 40 46PM-ezgif com-video-to-gif-converter](https://redirect.github.com/user-attachments/assets/0509b554-cbc6-48cc-adc5-ba491759895c) #### Prisma Postgres [Prisma Postgres](https://www.prisma.io/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. ![Clipboard-20251119-110343-691](https://redirect.github.com/user-attachments/assets/172b43ee-70b3-43c7-a3ca-2cc12873d1a4) ##### 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. - Compatible with Cloudflare Workers, Vercel Edge Functions, Deno Deploy, AWS Lambda, and Bun - Stream results row-by-row to handle large datasets with constant memory usage - Pipeline multiple queries over a single connection, reducing latency by up to 3x - SQL template literals with automatic parameterization and full TypeScript support - Built-in transactions, batch operations, and extensible type system [Check out the serverless driver docs](https://www.prisma.io/docs/postgres/database/serverless-driver) 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](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>. ### [`v6.19.3`](https://redirect.github.com/prisma/prisma/releases/tag/6.19.3) [Compare Source](https://redirect.github.com/prisma/prisma/compare/6.19.2...6.19.3) Today, we are issuing a 6.19.3 patch release in the Prisma 6 release line. It updates the `effect` dependency to resolve a security vulnerability. Changes: [#&#8203;29416](https://redirect.github.com/prisma/prisma/pull/29416) ### [`v6.19.2`](https://redirect.github.com/prisma/prisma/releases/tag/6.19.2) [Compare Source](https://redirect.github.com/prisma/prisma/compare/6.19.1...6.19.2) Today, we are issuing a 6.19.2 patch release in the Prisma 6 release line. It fixes an issue with Prisma Accelerate support in some edge runtime configurations when the `@prisma/client/edge` entrypoint is not being used. Changes: - [#&#8203;28934](https://redirect.github.com/prisma/prisma/pull/28934) ### [`v6.19.1`](https://redirect.github.com/prisma/prisma/compare/6.19.0...6.19.1) [Compare Source](https://redirect.github.com/prisma/prisma/compare/6.19.0...6.19.1) </details> <details> <summary>prisma/prisma (prisma)</summary> ### [`v7.7.0`](https://redirect.github.com/prisma/prisma/compare/7.6.0...7.7.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.6.0...7.7.0) ### [`v7.6.0`](https://redirect.github.com/prisma/prisma/releases/tag/7.6.0) [Compare Source](https://redirect.github.com/prisma/prisma/compare/7.5.0...7.6.0) Today, we are excited to share the `7.6.0` stable release 🎉 **🌟 Star this repo for notifications about new releases, bug fixes & features — or [follow us on X](https://pris.ly/x)!** ### Highlights #### ORM ##### Features **CLI** - Added a `prisma postgres link` command that connects a local project to a Prisma Postgres database. This is the first command in a new `prisma postgres` command group for managing Prisma Postgres databases directly from the CLI. ([#&#8203;29352](https://redirect.github.com/prisma/prisma/issues/29352)) **Driver Adapters** - **[@&#8203;prisma/adapter-pg](https://redirect.github.com/prisma/adapter-pg)**: Added a `statementNameGenerator` option that accepts a custom prepared statement name generator to allow users to leverage `pg` statement caching ([#&#8203;29395](https://redirect.github.com/prisma/prisma/issues/29395)) - **[@&#8203;prisma/adapter-pg](https://redirect.github.com/prisma/adapter-pg)**: Added support for usage of connection strings directly in the constructor for improved ergonomics ([#&#8203;29287](https://redirect.github.com/prisma/prisma/issues/29287)) - **[@&#8203;prisma/adapter-mariadb](https://redirect.github.com/prisma/adapter-mariadb)**: Added a `useTextProtocol` option in the constructor to toggle between text and binary protocols ([#&#8203;29392](https://redirect.github.com/pri </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 12pm on Sunday" - Automerge - At any time (no schedule defined) 🚦 **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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/wolfstar-project/wolfstar). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS45IiwidXBkYXRlZEluVmVyIjoiNDMuMTEwLjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: RedStar <redstar071@proton.me>
1 parent 5b6534f commit 0e4e2ab

10 files changed

Lines changed: 739 additions & 121 deletions

File tree

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ FROM base AS builder
2929
ENV NODE_ENV="development"
3030

3131
COPY --chown=node:node prisma/ prisma/
32+
COPY --chown=node:node prisma.config.ts prisma.config.ts
3233
COPY --chown=node:node src/ src/
3334
COPY --chown=node:node tsconfig.base.json tsconfig.base.json
3435
COPY --chown=node:node tsdown.config.ts tsdown.config.ts
@@ -49,6 +50,7 @@ ENV NODE_OPTIONS="--enable-source-maps --max_old_space_size=4096"
4950
WORKDIR /usr/src/app
5051

5152
COPY --chown=node:node --from=builder /usr/src/app/dist dist
53+
COPY --chown=node:node --from=builder /usr/src/app/generated ./generated
5254
COPY --chown=node:node --from=builder /usr/src/app/node_modules ./node_modules
5355
COPY --chown=node:node --from=builder /usr/src/app/src/.env src/.env
5456

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"#lib/i18n/languageKeys": "./dist/lib/i18n/languageKeys/index.mjs",
3131
"#lib/i18n": "./dist/lib/i18n/index.mjs",
3232
"#lib/*": "./dist/lib/*.mjs",
33+
"#generated/prisma": "./dist/generated/prisma/client.mjs",
3334
"#languages": "./dist/languages/index.mjs",
3435
"#root/*": "./dist/*.mjs"
3536
},
@@ -57,7 +58,8 @@
5758
"@discordjs/core": "^1.2.0",
5859
"@influxdata/influxdb-client": "^1.35.0",
5960
"@influxdata/influxdb-client-apis": "^1.35.0",
60-
"@prisma/client": "^6.19.0",
61+
"@prisma/adapter-pg": "^7.7.0",
62+
"@prisma/client": "^7.7.0",
6163
"@rollup/plugin-alias": "^6.0.0",
6264
"@sapphire/async-queue": "^1.5.5",
6365
"@sapphire/bitfield": "^1.2.4",
@@ -89,6 +91,7 @@
8991
"discord.js": "~14.25.1",
9092
"he": "^1.2.0",
9193
"husky": "^9.1.7",
94+
"pg": "^8.20.0",
9295
"zlib-sync": "^0.1.10"
9396
},
9497
"devDependencies": {
@@ -109,11 +112,11 @@
109112
"oxfmt": "^0.43.0",
110113
"oxlint": "^1.58.0",
111114
"prettier": "^3.7.2",
112-
"prisma": "^6.19.0",
113-
"prisma-json-types-generator": "^3.6.2",
115+
"prisma": "^7.7.0",
116+
"prisma-json-types-generator": "^4.1.1",
114117
"taze": "^19.9.2",
115118
"tsdown": "^0.21.7",
116-
"typescript": "~5.7.2",
119+
"typescript": "~5.9.3",
117120
"vitest": "^4.0.14"
118121
},
119122
"repository": {

pnpm-lock.yaml

Lines changed: 704 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prisma.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { config } from 'dotenv';
2+
import { defineConfig, env } from 'prisma/config';
3+
4+
config({ path: 'src/.env' });
5+
6+
export default defineConfig({
7+
schema: 'prisma/schema.prisma',
8+
migrations: {
9+
path: 'prisma/migrations'
10+
},
11+
datasource: {
12+
url: env('DATABASE_URL')
13+
}
14+
});

prisma/schema.prisma

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
generator client {
2-
provider = "prisma-client-js"
3-
previewFeatures = ["tracing"]
2+
provider = "prisma-client"
3+
output = "../src/generated/prisma"
44
}
55

66
generator json {
77
provider = "prisma-json-types-generator"
8+
output = "../src/generated/prisma"
89
}
910

1011
datasource db {
1112
provider = "postgresql"
12-
url = env("DATABASE_URL")
1313
}
1414

1515
model Guild {

src/lib/database/settings/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Guild as GuildData } from '@prisma/client';
1+
import type { Guild as GuildData } from '#generated/prisma';
22
import type { DeepReadonly, PickByValue } from '@sapphire/utilities';
33

44
export type GuildDataKey = keyof GuildData;
@@ -12,7 +12,7 @@ export type GuildSettingsOfType<T> = PickByValue<GuildData, T>;
1212
import type { SerializedEmoji } from '#utils/functions';
1313
import type { Snowflake } from 'discord.js';
1414

15-
export type { Guild as GuildData, Moderation as ModerationData, User as UserData } from '@prisma/client';
15+
export type { Guild as GuildData, Moderation as ModerationData, User as UserData } from '#generated/prisma';
1616

1717
export interface PermissionsNode {
1818
allow: readonly Snowflake[];

src/lib/schedule/manager/ScheduleEntry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ModerationManagerEntry } from '#lib/moderation';
22
import { Events } from '#lib/types/Enums';
33
import type { TypeVariation } from '#utils/moderationConstants';
4-
import type { Schedule } from '@prisma/client';
4+
import type { Schedule } from '#generated/prisma';
55
import { container } from '@sapphire/framework';
66
import { Cron } from '@sapphire/time-utilities';
77
import { isNullishOrEmpty } from '@sapphire/utilities';

src/lib/setup/prisma.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { PrismaClient } from '@prisma/client';
1+
import { PrismaPg } from '@prisma/adapter-pg';
2+
import { PrismaClient } from '#generated/prisma';
23
import { container } from '@sapphire/framework';
34

4-
const prisma = new PrismaClient().$extends({
5+
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL! });
6+
const prisma = new PrismaClient({ adapter }).$extends({
57
name: 'extensions',
68
model: {
79
user: {

tsdown.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export default defineConfig({
7070
}
7171
},
7272
{ find: /^#root\/(.*)/, replacement: resolve('src/$1.ts') },
73+
{ find: '#generated/prisma', replacement: resolve('src/generated/prisma/client.js') },
7374
{ find: '#languages', replacement: resolve('src/languages/index.ts') },
7475
{
7576
find: '#utils',

vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default defineConfig({
1919
{ find: /^#lib\/(.*)/, replacement: `${libRoot}/$1` },
2020
{ find: '#lib', replacement: libRoot },
2121
{ find: /^#root\/(.*)/, replacement: `${srcRoot}/$1.ts` },
22+
{ find: '#generated/prisma', replacement: `${srcRoot}/generated/prisma/client.js` },
2223
{ find: '#languages', replacement: `${srcRoot}/languages/index.ts` },
2324
{ find: /^#utils\/(.*)/, replacement: `${utilRoot}/$1` },
2425
{ find: '#utils', replacement: utilRoot }

0 commit comments

Comments
 (0)