Are Ecto.Multi or something equivalent supported in Ash?

Can I use Ecto.Multi or something equivalent to create more complex database queries inside a transaction using multiple resources?
3 Replies
ZachDaniel
ZachDaniel3y ago
Yes, you can use Ecto.Multi with ash resources. You can also use Ash.Flow
Blibs
BlibsOP3y ago
In Ash.Flow documenation, it says "...steps that are enclosed by a transaction. " Is this done automatically by Ash or should I do it somehow? Is there an example of that somewhere in the docs?
ZachDaniel
ZachDaniel3y ago
There is a transaction step that will wrap steps in a transaction, and additionally if a step for a resource is in a transaction it will run synchronously. You can also set the touches_resources on most steps in case there are other resources with other repos, or custom steps. You usually don’t need it though.

Did you find this page helpful?