Use .executeRaw()
with .transaction([])
#3150
Labels
kind/feature
A request for a new feature.
tech/engines
Issue for tech Engines.
topic: previewFeatures
Issue touches on an preview feature flag
topic: prisma-client
topic: $transaction
Related to .$transaction(...) Client API
topic: transaction
Milestone
Bug description
The response type for
.executeRaw()
variants are currently considered incompatible with those expected for use by.transaction([])
, resulting in this error message:All elements of the array need to be Prisma Client promises.
This means it's impossible to incorporate raw statement execution as part of a batched set of transactions that have to either all succeed or get rolled back.
How to reproduce
Using any database model you like, create an array of Prisma requests that are to be batch executed, which includes at least one being
prisma.executeRaw('{valid SQL statement')
, and observe the error is thrown during theawait prisma.transaction([])
usage.Expected behavior
The execution of the batched requests should complete without failure.
Environment & setup
The text was updated successfully, but these errors were encountered: