4 ms·
ORMs -- in my case ruby's ActiveRecord -- solve nearly every use-case I have. Find a record by its primary key; get a record and all of the associated records f
by generalk 14y ago
ORMs -- in my case ruby's ActiveRecord -- solve nearly every use-case I have. Find a record by its primary key; get a record and all of the associated records from another table; update a record with a bunch of data? Why should I write any of that SQL? It's a waste of time.
Is ActiveRecord running n+1 queries every time you call a method? You're doing it wrong. Ignorance of how an ORM works is not an indictment against ORMs.
Is ActiveRecord generating really bad SQL for the fifty-table report you want to generate? Fine, ditch it. Run your own custom-written SQL, or a stored procedure, or whatever. Just because an ORM can't write all the SQL you'll ever need does not mean that they're useless.