3 ms·
I'm really enjoying getting to grips with Elixir, but I'm still really in two minds about Ecto having a macro-based SQL ORM. Like any ORM, the abstraction leak
by ljm 3y ago
I'm really enjoying getting to grips with Elixir, but I'm still really in two minds about Ecto having a macro-based SQL ORM.
Like any ORM, the abstraction leaks, but it really throws you off course when you're trying to map the host syntax to raw SQL.
from(t as SomeTable, where: x.z == ^y, join: x on assoc(t, :y))
Like, it's macro enough to make SQL feel more first-class...but not enough to actually make it first class, so you've gotta learn Ecto's quirks.
It's also chainable so it's a macro over a query builder that eventually resolves to SQL at runtime.