detect findUniqueOrThrow small fixes #1
Merged
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.
These are a set of fixes from your PR at prisma#4014, which was already really good.
I will answer your questions in prisma#4014 (comment) here too:
As long as the
user_facing_error
part is correct, given we are not treating the error internally before returning, it's OK, the client will make use of that portion of the error, so I simplified the error expression in the handler codeFor the moment, the proposed level of optimization looks good, let's leave it this way and not try to batch different kind of operations for the moment.
I changed that to, instead to use a heap allocated string, use a
QueryOptions
bitflag byte, which was also used in other parts of the crate.I think that's an OK assumption.
Please let me know how the proposed changes below look into your proposed patch, and if you decide to merge them, we can follow-up with them.