News for hackers. Stuff that matters.
Re:DenoDB by nine_k on Friday June 18, 2021 @04:50AM (#27548555)
No, ORMs do much more. They turn slices of resultsets into objects. They lazy-load related objects instead of using one efficient join and doing one query; they in general have trouble representing results of projections and joins. They fetch all "attributes of the object" when you need to select a couple of columns from two dozen. They make the objects mutable, and introduce dirty state without transactional control. They allow running other code, including other DML, in hooks before or after loading or saving an object, leading to very strange errors sometimes, where a database trigger would fail to run and indicate an error. They make DML over a group of records, trivial and efficient in SQL, a litany of one-record updates, each requiring a round-trip.

They sort of allow a developer ignore the fact that the data are stored in an RDBMS. It looks cool in toy examples, and becomes progressively worse as your code starts doing serious things on serious amounts of data.

Re:DenoDB by supermatt on Friday June 18, 2021 @05:08AM (#27548635)
Sounds like all your gripes are from a naive usage of ORMs.

Rails ActiveRecord, for example, handles ALL your mentioned scenarios (includes, joins, select, Transaction.do, update_all - and you can still run SQL queries or fragments thereof).

Theres a lot more in the docs than you will see in "toy examples".

Of course, not all ORMs are created equally...

Re:DenoDB by OJFord on Friday June 18, 2021 @05:19AM (#27548690)
Not GP, and I've never used Rails so I'm not fanboying over it, but I've long had the impression that ActiveRecord is at least one of the most sophisticated ORMs; it wouldn't surprise me if it handles more complex cases better than others.

I think my preferred style (vs. full ORM or raw SQL) is that of Diesel (which is incidentally from a (former?) maintainer of ActiveRecord, Sean Griffin, though I think he may have since stepped back from it) for Rust - it's more like 'SQL bindings' than 'ORM's typically are or grow to be; so you pretty much write SQL, just in Rust syntax with type checking etc. instead of actual SQL in one big Rust string.

Re:DenoDB by nine_k on Friday June 18, 2021 @11:10PM (#27557389)
Indeed, I have seen a lot of semi-naive usage of ORMs, and enough expert usage that sidesteps the leaking abstractions and drops into non-ORM access.

Table models are hugely useful. "Business object" models, not as much.

Re:DenoDB by ttfkam on Friday June 18, 2021 @11:43PM (#27557550)
All uses of any technology are naive given enough members on a team.