-
-
Notifications
You must be signed in to change notification settings - Fork 892
Prisma 6.14.0 upgrade #2444
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
Prisma 6.14.0 upgrade #2444
Changes from all commits
1c3bcb8
c9f7bf3
779f8d0
b9f3f3a
59e8db3
a31f561
8b31009
ffb144d
75aa9d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,8 @@ | |
| **/dist | ||
| **/node_modules | ||
|
|
||
| **/generated/prisma | ||
|
|
||
| apps/webapp/build | ||
| apps/webapp/public/build | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import { env } from "~/env.server"; | ||
| import { logger } from "~/services/logger.server"; | ||
|
|
||
| export interface QueryPerformanceConfig { | ||
| verySlowQueryThreshold?: number; // ms | ||
| maxQueryLogLength: number; | ||
| } | ||
|
|
||
| export class QueryPerformanceMonitor { | ||
| private config: QueryPerformanceConfig; | ||
|
|
||
| constructor(config: Partial<QueryPerformanceConfig> = {}) { | ||
| this.config = { | ||
| maxQueryLogLength: 1000, | ||
| ...config, | ||
| }; | ||
| } | ||
|
|
||
| onQuery( | ||
| clientType: "writer" | "replica", | ||
| log: { | ||
| duration: number; | ||
| query: string; | ||
| params: string; | ||
| target: string; | ||
| timestamp: Date; | ||
| } | ||
| ) { | ||
| if (this.config.verySlowQueryThreshold === undefined) { | ||
| return; | ||
| } | ||
|
|
||
| const { duration, query, params, target, timestamp } = log; | ||
|
|
||
| // Only log very slow queries as errors | ||
| if (duration > this.config.verySlowQueryThreshold) { | ||
| // Truncate long queries for readability | ||
| const truncatedQuery = | ||
| query.length > this.config.maxQueryLogLength | ||
| ? query.substring(0, this.config.maxQueryLogLength) + "..." | ||
| : query; | ||
|
|
||
| logger.error("Prisma: very slow database query", { | ||
| clientType, | ||
| durationMs: duration, | ||
| query: truncatedQuery, | ||
| target, | ||
| timestamp, | ||
| paramCount: this.countParams(query), | ||
| hasParams: params !== "[]" && params !== "", | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| private countParams(query: string): number { | ||
| // Count the number of $1, $2, etc. parameters in the query | ||
| const paramMatches = query.match(/\$\d+/g); | ||
| return paramMatches ? paramMatches.length : 0; | ||
| } | ||
| } | ||
|
|
||
| export const queryPerformanceMonitor = new QueryPerformanceMonitor({ | ||
| verySlowQueryThreshold: env.VERY_SLOW_QUERY_THRESHOLD_MS, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ | |
| "@opentelemetry/sdk-trace-node": "1.25.1", | ||
| "@opentelemetry/semantic-conventions": "1.25.1", | ||
| "@popperjs/core": "^2.11.8", | ||
| "@prisma/instrumentation": "^5.11.0", | ||
| "@prisma/instrumentation": "^6.14.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain@prisma/instrumentation ^6.14.0 — version aligns with Prisma 6.14.0 Looks good. Please verify OTEL package versions don’t trigger peer warnings at runtime. 🏁 Script executed: #!/bin/bash
# Check for mismatched OTEL deps that could cause peer warnings
jq -r '.dependencies, .devDependencies | to_entries[] | select(.key|test("^@opentelemetry/")).key + "@" + .value' apps/webapp/package.json
# Grep for Prisma instrumentation registration occurrences
rg -nP '@prisma/instrumentation|PrismaInstrumentation' -C2Length of output: 7998 Ensure OpenTelemetry dependency versions are fully aligned
🤖 Prompt for AI Agents |
||
| "@radix-ui/react-accordion": "^1.2.11", | ||
| "@radix-ui/react-alert-dialog": "^1.0.4", | ||
| "@radix-ui/react-dialog": "^1.0.3", | ||
|
|
@@ -137,6 +137,7 @@ | |
| "dotenv": "^16.4.5", | ||
| "effect": "^3.11.7", | ||
| "emails": "workspace:*", | ||
| "eventsource": "^4.0.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainNew dependency: eventsource — confirm module format and Node support Ensure it works with your CJS server build and Node engine (>=16). Validate bundling and SSR usage. 🏁 Script executed: #!/bin/bash
# Where is eventsource used?
rg -nP '\beventsource\b' -C2 apps/webapp | sed -n '1,120p'
# Quick ESM/CJS check via package.json fields (requires network if not installed)
# If workspace is installed, peek installed metadata:
fd -a 'eventsource/package.json' node_modules | xargs -I{} jq '{name:.name,module:.module,main:.main,types:.types,type:.type,engines:.engines}' {}Length of output: 484 🏁 Script executed: #!/bin/bash
# Fetch module entrypoints and engine requirements for [email protected]
npm view [email protected] main module type engines --jsonLength of output: 645 [email protected] requires Node >= 20 and is published as ESM (with a CJS entrypoint)—verify runtime upgrade or pin to v3 The new “eventsource” dependency ships with
This means:
Please address:
• File: apps/webapp/package.json (line 140) 🤖 Prompt for AI Agents |
||
| "evt": "^2.4.13", | ||
| "express": "4.20.0", | ||
| "framer-motion": "^10.12.11", | ||
|
|
@@ -214,9 +215,9 @@ | |
| "@remix-run/dev": "2.1.0", | ||
| "@remix-run/eslint-config": "2.1.0", | ||
| "@remix-run/testing": "^2.1.0", | ||
| "@sentry/cli": "2.50.2", | ||
| "@swc/core": "^1.3.4", | ||
| "@swc/helpers": "^0.4.11", | ||
| "@sentry/cli": "2.50.2", | ||
| "@tailwindcss/forms": "^0.5.3", | ||
| "@tailwindcss/typography": "^0.5.9", | ||
| "@total-typescript/ts-reset": "^0.4.2", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| node_modules | ||
| # Ensure the .env symlink is not removed by accident | ||
| !.env | ||
|
|
||
| generated/prisma |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export * from "@prisma/client"; | ||
| export * from "../generated/prisma"; | ||
| export * from "./transaction"; |
Uh oh!
There was an error while loading. Please reload this page.