I’m sorry for my multi post with SOF.
I would like to retrieve id from previous inserted table primary key by Ecto Multi.
At first, I insert to A main table. then B details table needs A.id. I tried following code.
Multi.new()
|> Multi.insert(:insert, main) # insert 1 recode
|> Multi.insert_all(:insert_all, B, details) # insert 3 recodes with main id
|> Repo.transaction()
However I have no idea how to retrieve A.id for insert table B. What I should do for it?