Re:Elixir web development 101: collaborative todolist with r...
by out_of_protocol on Friday October 27, 2017 @11:21AM
(#15569248)
I don't see how Ecto is any worser than AR - imo it is not AND way more flexible. Also, `from ...` form is not the best choice - other form (e.g.
) allows query decomposition, the same way AR does.
[ Parent
| on HN ]
Re:Elixir web development 101: collaborative todolist with r...
by pmontra on Friday October 27, 2017 @12:22PM
(#15569845)
It is more flexible, but often that flexibility is not necessary. I replied in more detail to the sibling answer but in the Ecto version of this sample query, don't I have to write the definition of actual and by_email? AR gives me by_email for free. Instead, actual would be a scope and I have to write that code with AR too.
Re:Elixir web development 101: collaborative todolist with r...
by out_of_protocol on Friday October 27, 2017 @12:43PM
(#15570019)
Exactly the same:
Repo.get_by(Post, title: "My post")
https://hexdocs.pm/ecto/Ecto.Repo.html#c:get_by/3(Rails/AR deprecated find_by_xxx methods, promotes find_by() instead - for performance reasons)