38 ms·
I think it’s a false dichotomy that people against ORMs put out that the user of an ORM doesn’t know SQL well enough or sql is better than an ORM. An ORMs supe
by iterateoften 3y ago
I think it’s a false dichotomy that people against ORMs put out that the user of an ORM doesn’t know SQL well enough or sql is better than an ORM.
An ORMs super power is in easily composable queries. Something no easily don’t with SQL strings because of name conflicts and other issues. ORMs provide incredible benefits when it comes to sub queries and IN statements for instance.
ORMs are not a replacement for SQL strings or knowing SQL. Knowing SQL is sometimes a prerequisite for using some advanced features of an ORM to begin with.
Maybe it comes from people using crappy libs or perhaps some people just like something to feel superior about, but I’ll keep using my humble ORM. So many incredible benefits of ORMs and zero restrictions on just using raw SQL with them anyways.
- e12e 3y agoIt's more that "composing queries" in SQL is "CREATE VIEW" (and/or stored procedures/functions). It means you need some way to manage views.
- ryandv 3y agoThe property of composable queries is not unique to (or dare I say even characteristic of) ORMs, which are primarily concerned with mapping between tables or relations (in the relational algebra sense), and in-memory objects. It's the modelling of SQL as an AST that gives you that composability, and this does not require an ORM; see for instance arel (even though this was later absorbed into Rails' ActiveRecord ORM as an implementation detail...). [0] [0] https://github.com/brynary/arel https://github.com/brynary/arel
- mplanchard 3y agoIf I’m not mistaken, you’re describing a SQL query builder, not an ORM