Question about Transaction Optimization in Drizzle ORM #2677
Unanswered
hayata-suenaga
asked this question in
Q&A
Replies: 2 comments
-
I found |
Beta Was this translation helpful? Give feedback.
0 replies
-
Curious to know what the differences between |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the documentation examples for transactions using Drizzle ORM, each statement or query within a transaction is awaited. I have a scenario where I need to execute multiple
insert
andupdate
statements within a single transaction, but their order of execution doesn't matter. I have three questions:Is it safe and/or beneficial to not await these statements individually if I don't need them to execute in any particular order?
If I don't await these statements individually, will Drizzle ORM optimize the transaction by sending a single, batched transaction statement to the database instead of several separate statements?
Does Drizzle ORM provide any built-in methods for batch operations within a transaction that might be more suitable for this use case? In other words, I want to send a transaction via a singe network call as a single statement.
The following is the example transaction code found on the official Drizzle doc.
Beta Was this translation helpful? Give feedback.
All reactions