3 ms·
One of the many reasons I love Elixir Ecto: it is a pretty small abstraction on top of SQL. Gets out of your way and let's you write SQL in elixir
by honkycat 7y ago
One of the many reasons I love Elixir Ecto: it is a pretty small abstraction on top of SQL. Gets out of your way and let's you write SQL in elixir
- cultofmetatron 7y agoOMG YES, I LOVEE Ecto!. it lets you create beautiful sql like declarations ``` payment_types = from(s in Ecto.assoc(order_cycle, :splits)) |> join(:left, [s], p in assoc(s, :payments)) |> select([s, p], %{ type: p.type, card_type: p.card_type }) |> Repo.all() ``` its the first database library that makes queries easy to compose together. On top of that transactions are a snap to put together thanks to Ecto.Multi