4 ms·
Someone seems to write one of these every few years about whatever the flavor of the month is. I recall reading one from sometime in the early 2000s about Hiber
by __jal 10y ago
Someone seems to write one of these every few years about whatever the flavor of the month is. I recall reading one from sometime in the early 2000s about Hibernate that read the same way. And another one for one of the Perl ORMs before that.
Yet somehow, dirty, ugly, hard-to-write SQL is still here while ORMs keep coming and going. And I have yet to see one without an escape hatch allowing raw SQL.
- ZenoArrow 10y ago>"And I have yet to see one without an escape hatch allowing raw SQL." I don't know where you've been looking, but from what I've seen it's an easy to find feature. To give two examples: https://docs.djangoproject.com/en/1.10/topics/db/sql/ https://docs.djangoproject.com/en/1.10/topics/db/sql/ https://github.com/StackExchange/Dapper https://github.com/StackExchange/Dapper
- __jal 10y agoUnless my reading ability is broken, we seem to be agreeing. I said I have never seen one that doesn't have one. My point being that ORMs can't fully replace SQL, and the proof is they all provide an escape hatch.
- Daishiman 10y agoThey provide an escape hatch because the language has support for features such as temporary tables, native DB functions and transaction control that are nonstandard and have a hundred gotchas, and are therefore not amenable to implement in an ORM. I have 30k lines of business logic written for Django that does not use that hatch even once.
- __jal 10y agoAgain, I see point of disagreement, other than an odd bit of defensiveness about ORMs.