Skip to content
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

Use .executeRaw() with .transaction([]) #3150

Closed
pbelbin opened this issue Jul 27, 2020 · 1 comment · Fixed by prisma/prisma-engines#1213
Closed

Use .executeRaw() with .transaction([]) #3150

pbelbin opened this issue Jul 27, 2020 · 1 comment · Fixed by prisma/prisma-engines#1213
Assignees
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

Comments

@pbelbin
Copy link

pbelbin commented Jul 27, 2020

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 the await prisma.transaction([]) usage.

Expected behavior

The execution of the batched requests should complete without failure.

Environment & setup

  • OS: macOS 10.15.6
  • Database: MySQL 5.7
  • Prisma version: 2.3.0
@pbelbin pbelbin changed the title .executeRaw({statement}) unable to be used with .transaction([]) .executeRaw() unable to be used with .transaction([]) Jul 27, 2020
@janpio janpio added kind/feature A request for a new feature. topic: $transaction Related to .$transaction(...) Client API topic: previewFeatures Issue touches on an preview feature flag labels Jul 27, 2020
@janpio janpio changed the title .executeRaw() unable to be used with .transaction([]) Use .executeRaw() with .transaction([]) Aug 20, 2020
@janpio janpio added this to the Backlog 2.10.0 milestone Oct 14, 2020
@janpio janpio added the tech/engines Issue for tech Engines. label Oct 15, 2020
@dpetrick
Copy link
Contributor

This will be possible with the upcoming 2.10 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants