From fc38fb73825773025c0163336c966ffb3bfa3f93 Mon Sep 17 00:00:00 2001 From: Pedro Giroldo <68621927+pedrogiroldo@users.noreply.github.com> Date: Tue, 3 Mar 2026 10:51:46 -0300 Subject: [PATCH 1/3] Make @types/pg a direct dependency of adapter-pg (#29277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **What changed** `@types/pg` was moved from a `devDependency` to a regular `dependency` in `adapter-pg`'s `package.json`, and the pnpm lockfile entries were updated accordingly. **Why** When using `adapter-pg`, the TypeScript types for `pg` are not automatically available — they live in `@types/pg`, which is a separate package that the adapter consumed only as a dev dependency. Because of this, consumers who install `adapter-pg` end up with a poor developer experience: the adapter's types fail to load correctly at the consumer's side, since TypeScript can't resolve the underlying `pg` types without `@types/pg` being present. The problem is subtle and frustrating: the user has no reason to know that `adapter-pg` internally depends on `@types/pg`, and nothing tells them they need to install it manually. The fix is to make `@types/pg` a direct, non-dev dependency so it is automatically installed whenever `adapter-pg` is installed — both for the end user's type resolution and for the build itself. **Impact** No runtime behavior changes. This is a types-only fix that improves the out-of-the-box TypeScript experience for anyone using `adapter-pg`. ## Summary by CodeRabbit * **Chores** * Updated PostgreSQL adapter dependencies: moved type definitions from development-only to runtime dependencies so they're available when the adapter is installed. --- packages/adapter-pg/package.json | 6 +++--- pnpm-lock.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/adapter-pg/package.json b/packages/adapter-pg/package.json index 5a6e0fcbbe83..cd8399283653 100644 --- a/packages/adapter-pg/package.json +++ b/packages/adapter-pg/package.json @@ -38,10 +38,10 @@ "dependencies": { "@prisma/driver-adapter-utils": "workspace:*", "pg": "^8.16.3", - "postgres-array": "3.0.4" + "postgres-array": "3.0.4", + "@types/pg": "8.11.11" }, "devDependencies": { - "@prisma/debug": "workspace:*", - "@types/pg": "8.11.11" + "@prisma/debug": "workspace:*" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6da299595636..cbeea4adb226 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -303,6 +303,9 @@ importers: '@prisma/driver-adapter-utils': specifier: workspace:* version: link:../driver-adapter-utils + '@types/pg': + specifier: 8.11.11 + version: 8.11.11 pg: specifier: ^8.16.3 version: 8.16.3 @@ -313,9 +316,6 @@ importers: '@prisma/debug': specifier: workspace:* version: link:../debug - '@types/pg': - specifier: 8.11.11 - version: 8.11.11 packages/adapter-planetscale: dependencies: From 8e66b69afb2583bc6a58ab0bf73fdcfe186bbe1e Mon Sep 17 00:00:00 2001 From: Connor Tessaro Date: Tue, 3 Mar 2026 12:26:17 -0400 Subject: [PATCH 2/3] feat: add distinct field JSDoc to findMany operation (#29269) Fixes #5509 ## Summary by CodeRabbit * **Documentation** * Enhanced JSDoc documentation to include the `distinct` option for findMany operations in the JavaScript client generator * Added support for documenting the `distinct` option across findMany, findFirst, and findFirstOrThrow operations in the TypeScript client generator --- packages/client-generator-js/src/TSClient/jsdoc.ts | 1 + packages/client-generator-ts/src/TSClient/jsdoc.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/client-generator-js/src/TSClient/jsdoc.ts b/packages/client-generator-js/src/TSClient/jsdoc.ts index 5c605135be6a..8d85e8689f3d 100644 --- a/packages/client-generator-js/src/TSClient/jsdoc.ts +++ b/packages/client-generator-js/src/TSClient/jsdoc.ts @@ -236,6 +236,7 @@ ${onlySelect} skip: JSDocFields.skip, cursor: (singular, plural) => addLinkToDocs(`Sets the position for listing ${plural}.`, 'cursor'), take: JSDocFields.take, + distinct: JSDocFields.distinct, }, }, update: { diff --git a/packages/client-generator-ts/src/TSClient/jsdoc.ts b/packages/client-generator-ts/src/TSClient/jsdoc.ts index 5c605135be6a..8d85e8689f3d 100644 --- a/packages/client-generator-ts/src/TSClient/jsdoc.ts +++ b/packages/client-generator-ts/src/TSClient/jsdoc.ts @@ -236,6 +236,7 @@ ${onlySelect} skip: JSDocFields.skip, cursor: (singular, plural) => addLinkToDocs(`Sets the position for listing ${plural}.`, 'cursor'), take: JSDocFields.take, + distinct: JSDocFields.distinct, }, }, update: { From 1c96216bed45380f71be910cce47a9bf6cb88b57 Mon Sep 17 00:00:00 2001 From: Oleksii Orlenko Date: Tue, 3 Mar 2026 17:28:32 +0100 Subject: [PATCH 3/3] refactor(client-runtime-utils): use private property instead of WeakMap (#29052) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a private property instead of the `WeakMap` workaround and resolve the TODO comment. ## Summary by CodeRabbit * **Refactor** * Improved internal storage mechanism for better performance and maintainability. --- **Note:** This release contains internal optimizations with no changes to user-facing functionality or behavior. ✏️ Tip: You can customize this high-level summary in your review settings. --- packages/client-runtime-utils/src/nullTypes.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/client-runtime-utils/src/nullTypes.ts b/packages/client-runtime-utils/src/nullTypes.ts index e534d5267a54..bcc78145c2e7 100644 --- a/packages/client-runtime-utils/src/nullTypes.ts +++ b/packages/client-runtime-utils/src/nullTypes.ts @@ -4,25 +4,17 @@ */ const secret = Symbol() -/** - * Emulate a private property via a WeakMap manually. Using native private - * properties is a breaking change for downstream users with minimal TypeScript - * configs, because TypeScript uses ES3 as the default target. - * - * TODO: replace this with a `#representation` private property in the - * `ObjectEnumValue` class and document minimal required `target` for TypeScript. - */ -const representations = new WeakMap() - /** * Base class for unique values of object-valued enums. */ export abstract class ObjectEnumValue { + #representation: string + constructor(arg?: symbol) { if (arg === secret) { - representations.set(this, `Prisma.${this._getName()}`) + this.#representation = `Prisma.${this._getName()}` } else { - representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`) + this.#representation = `new Prisma.${this._getNamespace()}.${this._getName()}()` } } @@ -33,7 +25,7 @@ export abstract class ObjectEnumValue { } toString() { - return representations.get(this)! + return this.#representation } }