...

/

Optimize Multi with Changesets

Optimize Multi with Changesets

Learn how to optimize Multi with changesets.

One important consideration with Multi is that the transaction call works with unhandled errors the same way it does with functions in that they’re bubbled up to the transaction function.

Consider this example:

Press + to interact
alias Ecto.Multi
multi =
Multi.new\
|> Multi.insert(:artist, %Artist{})
Repo.transaction(multi)
widget
...