Conversation
#29287) ## Summary - Adds support for passing a raw connection string URL directly to `PrismaPg` (e.g., `new PrismaPg(process.env.DATABASE_URL)`) - The constructor now accepts `pg.Pool | pg.PoolConfig | string`, converting strings to `{ connectionString: string }` internally - This is a convenience feature — `pg.PoolConfig` already supports `{ connectionString: '...' }`, but accepting a plain string is more ergonomic Related: #29151 ## Test plan - [x] Added unit test verifying `PrismaPgAdapterFactory` accepts a connection string URL and creates a working adapter - [x] All existing adapter-pg tests pass (36/36) - [x] Lint passes with no new warnings > **Note:** The CodSpeed regression (`compile findUnique -97.77%`) is unrelated — this PR only touches `adapter-pg` constructor logic, not query compilation.
…29346) ## Summary - Adds `export` keyword to the `Get<Model>GroupByPayload` type in `client-generator-ts` so it's accessible to users after generation Fixes #29345 ## Problem In the `prisma-client` generator (Prisma 7), `Get<Model>GroupByPayload` is defined as a **private type** in each model file: ```typescript // generated/models/MealInteraction.ts export type MealInteractionGroupByArgs = { ... } // ✅ exported export type MealInteractionGroupByOutputType = { ... } // ✅ exported type GetMealInteractionGroupByPayload<T> = ... // ❌ NOT exported ``` In the old `prisma-client-js` generator, this type was accessible via the `Prisma` namespace (`Prisma.GetMealInteractionGroupByPayload<{...}>`). With the new per-model-file architecture, the missing `export` makes it completely unreachable. ## Fix One-line change in `packages/client-generator-ts/src/TSClient/Model.ts`: ```diff -type ${getGroupByPayloadName(model.name)}<T extends ${groupByArgsName}> = Prisma.PrismaPromise< +export type ${getGroupByPayloadName(model.name)}<T extends ${groupByArgsName}> = Prisma.PrismaPromise< ``` ## Test plan - [ ] Run `prisma generate` with `prisma-client` generator - [ ] Verify `GetMealInteractionGroupByPayload` is now exported from the generated model file - [ ] Verify it can be imported from the models barrel export - [ ] Verify `Awaited<GetMealInteractionGroupByPayload<{ by: [...], _count: {...} }>>` resolves correctly <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * The GroupBy payload type is now publicly exportable and can be imported for use in your TypeScript applications. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…onstant (#29317) ## Summary Closes #29316 Extracts the hardcoded `'prisma-client-js'` string literal into a shared `PRISMA_CLIENT_JS_PROVIDER` constant defined in `@prisma/internals`, replacing all occurrences across the codebase. ### Changes - **New**: `packages/internals/src/prisma-client-js-provider.ts` — single source of truth for the constant - **Modified** (8 files across 4 packages): - `packages/internals/src/index.ts` — export the constant - `packages/internals/src/cli/getGeneratorSuccessMessage.ts` — use constant - `packages/internals/src/utils/extractPreviewFeatures.ts` — use constant - `packages/cli/src/Generate.ts` — use constant (2 occurrences) - `packages/cli/src/utils/checkpoint.ts` — use constant - `packages/client-generator-js/src/generator.ts` — use constant - `packages/client-generator-js/src/utils/types/dmmfToTypes.ts` — use constant (2 occurrences) - `packages/client/src/utils/getTestClient.ts` — use constant ### Motivation This was identified during the review of #29315 by @coderabbitai. Having a single constant: - Eliminates risk of typos in the provider string - Makes it easy to find all usages via "Find References" - Provides a single place to update if the value ever changes ## Test plan - [x] `pnpm build` passes (43 tasks) - [x] `getGenerators` tests pass (40/40, 33 snapshots) - [x] No behavioral changes — pure mechanical refactor <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Standardized provider identifiers across internal modules using a centralized constant. * No changes to behavior or public APIs; end-user experience remains unchanged. * Improved internal consistency and reliability of provider detection and generator selection logic. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…tFound error (#29307) This pull request improves the handling and testing of PostgreSQL "ColumnNotFound" errors in the adapter. The main focus is on correctly extracting column names from error messages, regardless of whether the column name is quoted, and ensuring the tests cover both scenarios. We were getting "The column `(not available)` does not exist in the current database" error all the time, the sql was trying to get qualified name (e.g. schema.table_name) which generated postgres error message without quotes: `column table.column does not exist` vs `column "column" does not exist`. Our setup included: - multi-schema DB - custom @@Map() fields. - Postgres v18.3 Error handling improvements: * Updated the `mapDriverError` function in `errors.ts` to strip quotes from column names when parsing "ColumnNotFound" (42703) errors, ensuring consistent extraction of the column name. Testing enhancements: * Added a new test case for handling unquoted column names and clarified the description of the existing test for quoted column names in `errors.test.ts`, ensuring both cases are covered for "ColumnNotFound" errors. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved detection and normalization of PostgreSQL "column not found" errors so column names are identified correctly for unquoted, quoted, qualified, spaced, and escaped-quote formats, providing clearer, consistent error details. * **Tests** * Added comprehensive tests covering many column-name formats to ensure accurate detection and unchanged original error messaging. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )