I realize this is a DB question, but it involves Ecto and Postgrex so I thought I’d post here.
Suppose I have a multi with many inserts/updates using both
Multi.insert/update. I commit the changes to this multi using
Repo.transaction() (on a PostgreSQL DB using the Postgrex driver.)
I have a couple of questions. First, are the insert/updates batched? As in, if I have three inserts and two updates, will there be one round trip to the remote DB server or five round trips? Second, if indeed these statements are batched, how is it possible to get the updated DB state inside the multi before the multi is committed?