Hacker News new | ask | show | jobs
by zinclozenge 1165 days ago
I pretty much agree with this. As much as I liked the core language, I absolutely hated using anything else in the ecosystem, and in my opinion a lot of that was due to lack of static types. Using Ecto as the main way of interacting with the database was a miserable experience. Part of that was due to skill issue I'm sure.
4 comments

> As much as I liked the core language, I absolutely hated using anything else in the ecosystem, and in my opinion a lot of that was due to lack of static types.

You might be interested in Gleam[1].

[1] https://gleam.run/

> Using Ecto as the main way of interacting with the database was a miserable experience.

Ecto is prolly one of the best ways to interact with db. Genuinely curious, what other ORMs have you used?

I usually just write the SQL, honestly. For the last 6ish years of my career I've mainly been in the Golang world, so the closest I've gotten to an ORM is a utility to scan rows into structs.
Interesting, I usually just write the SQL too in most projects, but in Elixir I love Ecto because it's so close to the SQL but has an elegant and powerful way to handle interpolated values.
Have you tried sqlc? Different to any other SQL library I've used and suits Go really well
Yes, I like it very much. I've run into some edge cases with it, and I wish there was a setting to change the names of some of the autogenerated code, but otherwise it works very well.
Yeah, hopefully its plugin architecture will continue to develop and make changing things easier in the future.
On the flipside for me Ecto is the perfect balance between ORM and writing raw SQL queries. I've used many different ORMs like Entity Framework, ActiveRecord, Prisma, Ecto - Ecto stands alone.
I believe... technically Ecto is not an ORM but a query builder, which may be why you like it better than an ORM.
> Ecto as the main way of interacting with the database was a miserable experience

That's very common when you don't know DBs. But DB savy developers usually claim the opposite, because the syntax is more familiar.

> That's very common when you don't know DBs.

I'm not a 20 year DBA greybeard veteran, but I'm comfortable enough to write schemas and queries by hand without any issue, and the entire time I wished I could do just that instead of using Ecto.

No one stops you from writing raw SQL with Ecto.

But good luck creating composable SQL with raw string interpolation, which Ecto excels at.

PR reviewers stopped me from writing raw SQL.
Ecto queries are much closer to DB queries, when you use the macro syntax.

But if you come from an ORM perspective and expect the same experience on Ecto, yes I agree it won't please you.