3 ms·
You can use an ORM and hand written SQL. They are not mutually exclusive. I think hand written sql is overall safer than an ORM. With SQL it's easy to select o
by Foober223 7y ago
You can use an ORM and hand written SQL. They are not mutually exclusive.
I think hand written sql is overall safer than an ORM. With SQL it's easy to select only the fields you need, and only update fields you need. ORM's want to fill up an object. The ORM will try to load some binary file field that has no relevance to the current task. You have to jump through hoops to not load a field of an object. But now your ORM updates are broken. That field you didn't load might cause it to be nulled out when you update back to the DB. It's a tragedy this pattern has caught on.
Data should not be ham-fisted into an object. You select 2 fields, not 10. The result is a set, not a model object. I think the clojure ecosystem is good at treating data in it's true form without forcing transformations to fit an object model.