5 ms·
This looks interesting. The only db libraries I can stand are sql query builders. I have experienced way too much pain with orms over the years. They work until
by hankchinaski 3y ago
This looks interesting. The only db libraries I can stand are sql query builders. I have experienced way too much pain with orms over the years. They work until you have to do anything slightly complicated and they either get very difficult to use or very slow
- 5e92cb50239222b 3y agoIt's easy to drop down to pure SQL in every ORM I've ever used. Meanwhile, a good ORM gives you type safe queries, and saves from having to write boilerplate for trivial CRUD. I honestly would like to know which ORMs most critics have experience with. If it's something terrible like Hibernate, then no wonder. For reference, the ORM I've used the most is Entity Framework (the new one, rewritten for NET Core), and it's simply wonderful for 90%+ of my work, and doesn't get in the way for the rest of it.
- ushakov 3y agoModern ORMs like Drizzle and Prisma can probably generate more safe and efficient SQL queries than you could write by hand in a fourth of the time and effort
- kasey_junk 3y agoDrizzle is much closer to a classic sql builder than an orm. At least in my case the trouble with ORMs is mostly in the concept itself. Mapping sql results into objects defined as part of a business model. Just generating sql from native code is not an orm.
- kasey_junk 3y agoType safe sql is a feature of most every production quality db library I’ve used going back 20 years. You don’t need the complexity of an orm to get that. As for trivial boilerplate, I tend to find that trivial boilerplate no more troubling than any of the other compromises orms require, whether that’s polluting my data model with sql concerns or making me conform to db practices that aren’t correct for my needs. And I’ve got extensive experience with orm going back a long time, including Entity Framework (which is a good orm that I’d still prefer not to use).
- tptacek 3y agoI still find myself having the experience of having to unit test trivialities with direct SQL coding, lest I miss a typo, which is a (very basic) thing any ORM or query wrapper will tend to save me from.
- kasey_junk 3y agoI need to do the same thing with attributes, naming conventions, etc that are typically required to make orms work.
- dingxiong 3y agoYes ORM let me write plain SQL. But most time I find painful is the session management inside ORM. When does it decides to flush the query, and how it terminates an idle connection. In async mode, how does it add locks? When I try to customize the connection pool, and then all pain drives me away from ORM.
- makestuff 3y agoYou just gave me flashbacks to my first job out of college. It was this giant mess of hibernate with a combination of custom SQL queries mixed with the ORM that was responsible for billing data in the billions.
- JodieBenitez 3y ago> I honestly would like to know which ORMs most critics have experience with. I hated Doctrine. I like Django's ORM.
- parthdesai 3y agoEcto strikes the perfect balance IMO https://hexdocs.pm/ecto/Ecto.Query.html https://hexdocs.pm/ecto/Ecto.Query.html