Repository navigation
fix(client): safe and unsafe raw queries - #8728
Merged
Merged
Conversation
BREAKING CHANGE
Jolg42
reviewed
Aug 17, 2021
williamluke4
approved these changes
Aug 18, 2021
Jolg42
suggested changes
Aug 18, 2021
Jolg42
left a comment
Contributor
There was a problem hiding this comment.
Looks good! (didn't review everything in detail yet though)
See comment
and what's the state of
TODO:
add runtime checks (exceptions)
Do not merge now I guess, only for next release?
Contributor
Author
|
@Jolg42 the current changes are TS-only changes, we'd like to add an error for JS users too (runtime). |
Contributor
|
Tracked in #8808 now |
Jolg42
reviewed
Sep 6, 2021
Jolg42
reviewed
Sep 6, 2021
Jolg42
reviewed
Sep 6, 2021
Jolg42
reviewed
Sep 6, 2021
Jolg42
reviewed
Sep 6, 2021
Jolg42
suggested changes
Sep 6, 2021
Jolg42
left a comment
Contributor
There was a problem hiding this comment.
Looks great! Added a few comments
And need to check the failing tests
FAIL src/__tests__/integration/happy/raw-transactions/test.ts (5.761 s)
● transaction › queryRaw
All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.
977 | !p?.isExecuteRaw
978 | ) {
> 979 | throw new Error(
| ^
980 | `All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.`,
981 | )
982 | }
at PrismaClient.$___transactionInternal (src/runtime/getPrismaClient.ts:979:17)
at PrismaClient.$___transaction (src/runtime/getPrismaClient.ts:1015:21)
at PrismaClient.$transaction (src/runtime/getPrismaClient.ts:1031:21)
at Object.<anonymous> (src/__tests__/integration/happy/raw-transactions/test.ts:21:30)
...
...
janpio
reviewed
Sep 6, 2021
Jolg42
approved these changes
Sep 6, 2021
Jolg42
left a comment
Contributor
There was a problem hiding this comment.
Pre-approval, for the small changes in progress
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #7142
Fixes #8189
Fixes #8808
BREAKING CHANGE