Post

#AshFramework atomic updates are extremely powerful. When you add a where: [changing(:name)] condition, in an atomic context it compiles into the UPDATE statement itself. The condition becomes a CASE expression in SQL. One atomic query. #ElixirLang

3 reposts25 likes

This composes further. Validations work the same way. The validation becomes an expression. The whole action: conditional changes, conditional validations, policies, one trip to the database. We even use savepoints to ensure errors have the same transaction semantics. 😎