Bulk Delete/Truncate
What is the best way to delete all resources that pass a filter, or in some cases truncate a table to ensure it is empty. This is mostly for admin type functions to reset after some issue with normal operation where the data can be reloaded afterwards.
2 Replies
Currently we don't have bulk destroys (but we will). You have two options:
1. roll your own with ecto.
Repo.delete_all(from row in Resource, where: ...)
ought to work
2. roll your own assisted by ash
THanks, I ended up doing 1, but will revise when you have it directly supported.