3 ms·
My biggest gripe with Ecto is that it's incredibly verbose and awkward to use for one-off tasks directly from the console. I know it's by design and its design
by methyl 6y ago
My biggest gripe with Ecto is that it's incredibly verbose and awkward to use for one-off tasks directly from the console. I know it's by design and its design works wonders from maintainability and composability point of view, but I really miss Rails' ActiveRecord when fiddling with data. It's to the point I sometimes prefer to use raw SQL, which is astounding.
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.
- dqv 6y ago>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?). #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.
- methyl 6y ago> #iex:break? TIL. Does that differ from CTRL+G, i, c as in won't loose the context?
- d3ckard 6y agoYou actually can do that. Your project can define IIRC ".iex.exs" file that gets executed before you enter iex, so you can have all utility aliases and imports there.
- davidw 6y agoOne of the things I like about Elixir compared to Erlang is that it has a lot more beginner-friendly stuff as opposed to "oh, that's trivial to code up" that I have occasionally seen in the Erlang world. If it is, do it and make it available so that someone getting their feet wet has it available!
- realusername 6y agoOn my case I've added first(), last() and a few other ones I was using with rails to MyApp.Schema, this way it's a bit more usable in the console.