How to Compose Queries in Ecto (2019)
medium.com
medium.com
If anyone is curios and wants to get a high level overview, this conference talk by Darin Wilson provides a helpful intro to the patterns Ecto uses that differ from other popular ORMs.
Part of the offender is terrible UX of iex (like, why the heck can't I cancel multi-line command and not loose all my context?).
I believe improving on those two could lead to greater adoption of Elixir and Phoenix.
#iex:break?
But I do agree that it would help if there were just a default helper module that collected Ecto.Query and all the app schemas. It can be pretty annoying to have to re-alias schemas.
TIL. Does that differ from CTRL+G, i, c as in won't loose the context?
The problem with that is that it becomes a bit harder to parse what the query actually is, which columns are effectively involved, and which indices to you want to create to make sure they support it. This is somewhat similar to what's briefly mentioned in a recent post by Sasa Juric: https://medium.com/very-big-things/towards-maintainable-elix...
Another thing is that I really wish they would find a way to make it more obvious/easier to understand that `Changeset` is a formidable tool for pure data validation, without necessarily involving a DB, or even a Schema.
Other than that, it's a great tool :)
I do agree about Changesets—they took me quite a while to grok, but I really like them now.
In fact it never occurred to me that you could use a default argument that is not towards the end of the arguments.
Also I'm not surprised he uses the pipe format when compositing a query because I tried with the macro format and never succeeded to make it work.