-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Upgrade Prisma and related dependencies to v6.x.x #2977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughDependency bumps in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant OGRoute as OG Route (/api/og/partner-rewind)
participant API as getPartnerRewind
participant DB as PlanetScale DB
participant Renderer as Image Renderer
Client->>OGRoute: GET /api/og/partner-rewind?partnerId=<id>
OGRoute->>API: getPartnerRewind(partnerId)
API->>DB: parameterized SELECT (bind partnerId)
DB-->>API: row or empty
API-->>OGRoute: partner rewind row or null
alt row found
OGRoute->>OGRoute: read fonts from filesystem (Inter, Satoshi) & load medallion.jpg
OGRoute->>Renderer: render OG image using row data
Renderer-->>OGRoute: image bytes
OGRoute-->>Client: 200 OK (image)
else no row
OGRoute-->>Client: 404 / null response
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
🧰 Additional context used🧠 Learnings (6)📓 Common learnings📚 Learning: 2025-08-16T11:14:00.667ZApplied to files:
📚 Learning: 2025-10-06T15:48:45.956ZApplied to files:
📚 Learning: 2025-09-24T16:13:00.387ZApplied to files:
📚 Learning: 2025-10-28T19:17:28.085ZApplied to files:
📚 Learning: 2025-10-15T01:52:37.048ZApplied to files:
🔇 Additional comments (12)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
apps/web/package.jsonpackages/prisma/package.jsonpackages/prisma/schema/schema.prisma
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: TWilson023
Repo: dubinc/dub PR: 2935
File: packages/prisma/schema/workspace.prisma:21-36
Timestamp: 2025-10-06T15:48:45.956Z
Learning: In the Dub repository (dubinc/dub), Prisma schema changes are not managed with separate migration files. Do not flag missing Prisma migration files when schema changes are made to files like `packages/prisma/schema/workspace.prisma` or other schema files.
📚 Learning: 2025-10-06T15:48:45.956Z
Learnt from: TWilson023
Repo: dubinc/dub PR: 2935
File: packages/prisma/schema/workspace.prisma:21-36
Timestamp: 2025-10-06T15:48:45.956Z
Learning: In the Dub repository (dubinc/dub), Prisma schema changes are not managed with separate migration files. Do not flag missing Prisma migration files when schema changes are made to files like `packages/prisma/schema/workspace.prisma` or other schema files.
Applied to files:
packages/prisma/schema/schema.prisma
🔇 Additional comments (1)
packages/prisma/package.json (1)
21-23: LGTM!The
prismaCLI version is correctly aligned with@prisma/clientat6.19.1.
| generator client { | ||
| provider = "prisma-client-js" | ||
| previewFeatures = ["fullTextSearch", "fullTextIndex", "driverAdapters", "prismaSchemaFolder", "omitApi"] | ||
| provider = "prisma-client-js" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Prisma 6 preview features general availability GA release notes
💡 Result:
Prisma 6 promoted the following Preview features to General Availability (GA):
- fullTextIndex. [1]
- fullTextSearch — promoted to GA for MySQL; if you used it with PostgreSQL you must switch to the renamed preview flag fullTextSearchPostgres. [1][2]
Sources: Prisma upgrade guide and Prisma changelog. [1] https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-6 [2] https://www.prisma.io/changelog
🌐 Web query:
Prisma 6 driverAdapters preview feature status generally available
💡 Result:
As of Dec 23, 2025 the driverAdapters feature in Prisma 6 is still a Preview feature (not generally available). See the Prisma 6 release notes and docs which instruct enabling previewFeatures = ["driverAdapters"] and describe it as Preview. [1][2][3]
Sources
- Prisma 6.9.0 release announcement (notes driverAdapters as a Preview flag). [1]
- Prisma docs on using Prisma without Rust engines (shows driverAdapters as a preview feature). [2]
- Prisma 6.10.0 release notes (continued Preview status and driver-adapter work). [3]
🏁 Script executed:
cd packages/prisma/schema && git show HEAD:schema.prisma | head -20Repository: dubinc/dub
Length of output: 227
🏁 Script executed:
git show HEAD:packages/prisma/schema/schema.prisma | head -20Repository: dubinc/dub
Length of output: 475
🏁 Script executed:
git diff HEAD~1 HEAD -- packages/prisma/schema/schema.prisma | head -50Repository: dubinc/dub
Length of output: 82
🏁 Script executed:
git log --oneline packages/prisma/schema/schema.prisma | head -10Repository: dubinc/dub
Length of output: 86
🏁 Script executed:
git show dfb134277^:packages/prisma/schema/schema.prisma 2>/dev/null | head -20Repository: dubinc/dub
Length of output: 36
🏁 Script executed:
git show dfb134277 -- packages/prisma/schema/schema.prisma | head -60Repository: dubinc/dub
Length of output: 2158
🏁 Script executed:
git log --all --diff-filter=D -- "**/schema.prisma" | head -20Repository: dubinc/dub
Length of output: 365
🏁 Script executed:
git show dfb134277~1:packages/prisma/schema.prisma 2>&1 | head -20Repository: dubinc/dub
Length of output: 95
🏁 Script executed:
git log --all --oneline -- "packages/prisma/**" | head -20Repository: dubinc/dub
Length of output: 1131
🏁 Script executed:
git show d2284af7f | grep -A 20 "schema.prisma" | head -50Repository: dubinc/dub
Length of output: 1439
🏁 Script executed:
git show d2284af7f:apps/web/prisma/schema/schema.prisma | grep -A 5 "generator client"Repository: dubinc/dub
Length of output: 223
🏁 Script executed:
git show fef026a81:apps/web/prisma/schema/schema.prisma 2>&1 | grep -A 5 "generator client"Repository: dubinc/dub
Length of output: 36
🏁 Script executed:
git log --all -p -- packages/prisma/schema/schema.prisma 2>&1 | grep -B 5 -A 5 "previewFeatures" | head -40Repository: dubinc/dub
Length of output: 1103
🏁 Script executed:
git show dfb134277:packages/prisma/schema/schema.prisma | grep -A 3 "generator client"Repository: dubinc/dub
Length of output: 107
Restore previewFeatures array — driverAdapters, prismaSchemaFolder, and omitApi remain preview features in Prisma 6.
The previewFeatures array was completely removed, but only fullTextIndex and fullTextSearch became generally available in Prisma 6. The features driverAdapters, prismaSchemaFolder, and omitApi remain preview features and must be re-enabled. Removing them will break functionality if the application depends on these features.
Update the generator block to:
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch", "fullTextIndex", "driverAdapters", "prismaSchemaFolder", "omitApi"]
}
🤖 Prompt for AI Agents
In packages/prisma/schema/schema.prisma around lines 7 to 9, the generator block
was stripped of the previewFeatures array which removed required preview flags;
restore the previewFeatures entry to re-enable driverAdapters,
prismaSchemaFolder, and omitApi (keep fullTextSearch and fullTextIndex too) by
adding previewFeatures =
["fullTextSearch","fullTextIndex","driverAdapters","prismaSchemaFolder","omitApi"]
inside the generator client block so Prisma 6 retains those preview features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai are you absolutely sure? what is your source here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Prisma 6 prismaSchemaFolder feature generally available or preview
💡 Result:
The prismaSchemaFolder feature is Generally Available (GA) — it was promoted out of Preview in Prisma v6.7.0. [1][2][3]
References:
- Prisma blog / multi-file schema post noting GA in v6.7.0. [1]
- Prisma changelog announcing prismaSchemaFolder moved to GA. [2]
- Prisma docs / release notes (upgrade to v6) and related discussion/issues showing it was previously a Preview and had fixes around v6.6–6.7. [3]
🌐 Web query:
Prisma 6 omitApi feature generally available or preview status
💡 Result:
The omitApi (the client "omit" option) is generally available (GA) as of Prisma ORM 6.2.0 — you no longer need the preview flag. Earlier releases (5.13.0 → 6.1.x) required preview; a 6.2.1 patch fixed leftover preview checks. [1][2][3]
Sources:
- Prisma docs — Excluding fields (notes that omit is GA in 6.2.0 and was preview in 5.16–6.1). [1]
- Prisma 6.2.0 release notes / announcements (omit promoted to GA). [2]
- 6.2.1 release note mentioning removal/fix of omitApi preview checks. [3]
🏁 Script executed:
#!/bin/bash
# Check if driverAdapters are actually being used in the codebase
rg -n "PrismaClient|prisma\." packages/prisma/ -A 3 -B 3 | head -100
Length of output: 1387
🌐 Web query:
Prisma 6.19 driverAdapters preview feature required for adapter
💡 Result:
Yes — to use driver adapters in Prisma v6 (including v6.19) you must opt in to the driverAdapters preview feature in your client generator. Add previewFeatures = ["driverAdapters"] (and run prisma generate) and install the adapter package (e.g. @prisma/adapter-neon, @prisma/adapter-planetscale, etc.). [1][2][3]
Example:
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}
Then install the adapter and run:
npm install @prisma/adapter-
npx prisma generate
References: Prisma 6.19 announcement, Serverless database drivers blog, and Preview-features docs. [1][2][3]
@steven-tey I apologize - I need to correct my previous comment. After verifying against the latest Prisma documentation, here's the accurate status of each feature:
Features that became GA (no longer need preview flags):
fullTextSearchandfullTextIndex- GA in Prisma 6.0prismaSchemaFolder- GA in Prisma v6.7.0omitApi- GA in Prisma v6.2.0
Feature that still requires preview flag:
driverAdapters- Still preview in Prisma 6.19
Looking at your codebase, packages/prisma/edge.ts uses the PlanetScale adapter:
const adapter = new PrismaPlanetScale(client);
export const prismaEdge = new PrismaClient({
adapter,
});This means you DO need to restore the preview feature, but only driverAdapters:
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}Sources:
- Prisma 6 upgrade guide
- Prisma 6.19 announcement - confirms driverAdapters still requires preview flag
- Prisma v6.7.0 changelog - prismaSchemaFolder became GA
- Prisma v6.2.0 release - omitApi became GA
🧠 Learnings used
Learnt from: TWilson023
Repo: dubinc/dub PR: 2935
File: packages/prisma/schema/workspace.prisma:21-36
Timestamp: 2025-10-06T15:48:45.956Z
Learning: In the Dub repository (dubinc/dub), Prisma schema changes are not managed with separate migration files. Do not flag missing Prisma migration files when schema changes are made to files like `packages/prisma/schema/workspace.prisma` or other schema files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
apps/web/app/api/og/partner-rewind/route.tsx (3)
158-169: Replaceanytype with proper type orunknownfor percentile fields.The percentile fields are typed as
any, which bypasses TypeScript's type checking. Since these are database Decimal values that will be converted to numbers, consider using a more specific type or at leastunknownto maintain type safety until conversion.🔎 Proposed type improvement
type Row = { id: string; year: number; totalClicks: number; totalLeads: number; totalRevenue: number; totalEarnings: number; - clicksPercentile: any; // Decimal - leadsPercentile: any; // Decimal - revenuePercentile: any; // Decimal - earningsPercentile: any; // Decimal + clicksPercentile: string | number; // Decimal from database + leadsPercentile: string | number; // Decimal from database + revenuePercentile: string | number; // Decimal from database + earningsPercentile: string | number; // Decimal from database };
171-199: SQL query is properly parameterized.The query correctly uses parameterized binding with
?placeholder (line 197) and passesrewindIdas a parameter (line 198), preventing SQL injection vulnerabilities. The percentile calculations follow a consistent pattern.Consider query performance optimization.
Each percentile calculation uses two subqueries (one for count comparison, one for total count). With four percentile fields, this results in 8 subqueries per request. If performance becomes an issue, consider computing percentiles in application code or using window functions if the database supports them.
201-211: Consider error handling for percentile conversions.The
Number()conversions (lines 207-210) could potentially returnNaNif the database returns unexpected values. While thePartnerRewindSchema.parse()will validate the final result, the conversion assumes the percentile values are numeric. Consider adding validation or using a safer conversion approach if there's any uncertainty about the database return types.🔎 Optional: Add defensive conversion
return PartnerRewindSchema.parse({ ...firstRow, - clicksPercentile: Number(firstRow.clicksPercentile), - leadsPercentile: Number(firstRow.leadsPercentile), - revenuePercentile: Number(firstRow.revenuePercentile), - earningsPercentile: Number(firstRow.earningsPercentile), + clicksPercentile: Number(firstRow.clicksPercentile) || 0, + leadsPercentile: Number(firstRow.leadsPercentile) || 0, + revenuePercentile: Number(firstRow.revenuePercentile) || 0, + earningsPercentile: Number(firstRow.earningsPercentile) || 0, });
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/app/api/og/partner-rewind/route.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: TWilson023
Repo: dubinc/dub PR: 2935
File: packages/prisma/schema/workspace.prisma:21-36
Timestamp: 2025-10-06T15:48:45.956Z
Learning: In the Dub repository (dubinc/dub), Prisma schema changes are not managed with separate migration files. Do not flag missing Prisma migration files when schema changes are made to files like `packages/prisma/schema/workspace.prisma` or other schema files.
🧬 Code graph analysis (1)
apps/web/app/api/og/partner-rewind/route.tsx (2)
packages/email/src/react-email.d.ts (1)
Row(9-9)apps/web/lib/zod/schemas/partners.ts (1)
PartnerRewindSchema(345-356)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (3)
apps/web/app/api/og/partner-rewind/route.tsx (3)
18-25: Inconsistent AI summary regarding Satoshi Bold font.The AI summary states "removed Satoshi-Bold font usage", but the code still loads Satoshi Bold (lines 18-24), includes it in the fonts array (lines 146-149), and uses it in the rendered component (line 123). The font loading appears correct; the summary is inaccurate.
111-111: The JPG medallion image is accessible and properly deployed.The URL
https://assets.dub.co/misc/partner-rewind-2025/top-medallion.jpgreturns HTTP 200 with correct JPEG content type and appropriate file size (11.9 KB).
1-1: > Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (4)
apps/web/app/api/og/partner-rewind/route.tsx (4)
159-170: Improve type safety for decimal fields.Using
anyfor percentile fields bypasses type checking. Consider usingstringorunknownand explicitly documenting that these are Decimal types from the database, or use a proper Decimal type if available.🔎 Suggested type improvement
type Row = { id: string; year: number; totalClicks: number; totalLeads: number; totalRevenue: number; totalEarnings: number; - clicksPercentile: any; // Decimal - leadsPercentile: any; // Decimal - revenuePercentile: any; // Decimal - earningsPercentile: any; // Decimal + clicksPercentile: string | number; // Decimal from DB + leadsPercentile: string | number; // Decimal from DB + revenuePercentile: string | number; // Decimal from DB + earningsPercentile: string | number; // Decimal from DB };
172-200: Consider SQL query performance impact.The percentile calculation executes 8 subqueries (2 per percentile × 4 percentiles), each scanning the
PartnerRewindtable. For large datasets, this could be slow.Consider:
- Using SQL window functions (e.g.,
PERCENT_RANK()) for more efficient percentile calculation- Pre-computing percentiles during data ingestion if query performance becomes an issue
- Adding database indexes on
yearand metric columnsHowever, if the current performance is acceptable for your dataset size, this can be deferred.
💡 Example using window functions (more efficient)
WITH percentiles AS ( SELECT id, year, totalClicks, totalLeads, totalRevenue, totalEarnings, PERCENT_RANK() OVER (PARTITION BY year ORDER BY totalClicks) as clicks_rank, PERCENT_RANK() OVER (PARTITION BY year ORDER BY totalLeads) as leads_rank, PERCENT_RANK() OVER (PARTITION BY year ORDER BY totalRevenue) as revenue_rank, PERCENT_RANK() OVER (PARTITION BY year ORDER BY totalEarnings) as earnings_rank FROM PartnerRewind ) SELECT id, year, totalClicks, totalLeads, totalRevenue, totalEarnings, ROUND(100 * clicks_rank) as clicksPercentile, ROUND(100 * leads_rank) as leadsPercentile, ROUND(100 * revenue_rank) as revenuePercentile, ROUND(100 * earnings_rank) as earningsPercentile FROM percentiles WHERE id = ?Note: Verify PlanetScale supports window functions before implementing.
208-211: Document decimal precision handling.Converting database decimals to JavaScript numbers using
Number()may lose precision for very large values. For percentiles (0-100 range), this is safe. However, consider documenting this assumption or validating the range.
156-157: Document the reasoning for PlanetScale migration.The comment mentions this approach was chosen because "couldn't get that to work with dynamic client + conditional Prisma.sql." Consider documenting in the PR description or code comments why PlanetScale was chosen over Prisma v6, especially if Prisma v6 should theoretically support this use case.
This helps future maintainers understand if this is a temporary workaround or a permanent architectural decision.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/app/api/og/partner-rewind/route.tsx
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: TWilson023
Repo: dubinc/dub PR: 2935
File: packages/prisma/schema/workspace.prisma:21-36
Timestamp: 2025-10-06T15:48:45.956Z
Learning: In the Dub repository (dubinc/dub), Prisma schema changes are not managed with separate migration files. Do not flag missing Prisma migration files when schema changes are made to files like `packages/prisma/schema/workspace.prisma` or other schema files.
🧬 Code graph analysis (1)
apps/web/app/api/og/partner-rewind/route.tsx (2)
apps/web/app/(ee)/api/partner-profile/rewind/route.ts (1)
GET(7-19)apps/web/lib/zod/schemas/partners.ts (1)
PartnerRewindSchema(345-356)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (1)
apps/web/app/api/og/partner-rewind/route.tsx (1)
112-112: No action needed. The JPG asset exists and is properly accessible (HTTP 200), and JPG is an appropriate format for a 6×6 pixel medal badge where transparency is not a concern.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Summary by CodeRabbit
Chores
Bug Fixes / UI
Backend
Frontend / Public API
✏️ Tip: You can customize this high-level summary in your review settings.