Hi, does anyone have idea whether `executeRaw` mut...
# orm-help
r
Hi, does anyone have idea whether
executeRaw
mutations support transactions?
s
You should be able to send multiple statements in a single call to executeRaw, including opening a transaction. Please open an issue on Github if this does not work.
👍 1
r
@sorenbs It looks like
executeRaw
accepts only single SQL statement. Adding multiple statements separated by semicolon gives MySQL syntax error. I found similar comment in one of the github issues raised for executeRaw: https://github.com/prisma/prisma/issues/3300#issuecomment-429153325 It looks like we won't be able to use it to perform transactions yet.
Could you please help me in figuring out how ids are generated by Prisma? I am trying to write raw queries since there is no way to perform transactions with Prisma. I am assuming this is the code that generates id and Cuid is used when type of id is set to `ID`: https://github.com/prisma/prisma/blob/1.11.1/server/servers/api/src/main/scala/com/prisma/api/mutactions/NodeIds.scala#L13https://github.com/prisma/prisma/blob/1.11.1/server/servers/api/src/main/scala/com/prisma/api/mutactions/NodeIds.scala#L13
s
That is correct, we are generating cuids. I will see what we can do to enable transactions in executeRaw. ps: As you have probably realised by now, I am usually very slow to respond, so consider raising questions in the forum instead for more visibility 🙂
r
No problem, I can understand it is difficult to reply to so many messages 🙂 We are dropping idea of writing raw queries as we feel it might result in inconsistencies but would love to see support for transactions for multiple mutations in Prisma.