fix: including Prisma.sql for Prisma v6 upgrade #7
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.
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist
Prompt used to fix this problem
After upgrading Prisma to v6, things are broken. Fix all the $queryRaw usages from
to
We're basically extracting the whole query as Prisma.sql, and pass the query to queryRaw.
But this needs to be fixed only when the $queryRaw
.....includes a parameter that is an instance of Prisma.sql. So no need to fix something like this, because the parameterized values (someString) is primitive values, and not an instance of Prisma.sql....Summary by cubic
Updates raw SQL calls to the Prisma v6-safe pattern by extracting queries into Prisma.sql and passing them to $queryRaw, fixing runtime errors when interpolating Sql fragments. Touches Insights booking and routing services; no behavior changes expected.
$queryRawtemplate usage withconst query = Prisma.sql...; await prisma.$queryRaw(query)where Prisma.Sql fragments (e.g., baseConditions, case statements) are interpolated.