News for hackers. Stuff that matters.
Re:How to Sell Elixir Again (2023) by POiNTx on Saturday May 13, 2023 @03:27PM (#35931818)
Agree with all you said, except for the ORM part.

Ecto is good but I think the Django ORM does it better. The ORM in Django[0] is dead simple and easy to understand. The only caveat being that Django doesn't have changesets, which I do like.

It also integrates nicely with the Django Admin. You setup your models, and you can very easily generate an admin interface to CRUD on those models.

One annoyance I have with Ecto is that migration files are handwritten. There's a generator tool, but it only gives you a skeleton migration that you then have to manually fill in. This gives you 2 sources of truth, which is error prone. Automating this process like in Django solves this issue.

Ash[1] (which uses Ecto under the hood) does solve most of these issues, although at the moment the documentation can be hard to navigate.

[0] https://docs.djangoproject.com/en/4.2/topics/db/queries/

[1] https://ash-hq.org/

Re:How to Sell Elixir Again (2023) by melx on Saturday May 13, 2023 @05:38PM (#35933012)
Django ORM is nice but too simple for some advanced examples. Tried to solve some Postgres CTE in Django? Good luck.
Re:How to Sell Elixir Again (2023) by sph on Sunday May 14, 2023 @10:56AM (#35938479)
> Ecto is good but I think the Django ORM does it better.

Oh no, I strongly disagree. I know both very well, and Ecto is much better and flexible. SQLAlchemy was great, when I last used it two aeons ago, but still subpar compared to Ecto.

But also apples and oranges. Django has an ORM (i.e. stateful), Ecto is a stateless data mapper.