Zach Daniel @zachdaniel.dev · Apr 13

#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

25 likes 2 replies

?

Replies

Nick Wray · Apr 13

Zach Daniel · Apr 13

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. 😎