Thanks @LostKobrakai
I do a quick check. Is it what you meant?
Multi.new()
|> Multi.run(:validate_coupon, fn _repo, _ ->
validate_coupon(coupon_id)
end)
|> Multi.run(:increase_counter, fn _repo, _ ->
increase_counter(coupon_id)
end)
|> Repo.transaction()
I’m searching in the doc but it’s seems like there are still two roundtrips to the databases. Did i miss something?


















