5 ms·
"Don't try to force it: If you hit something weird, never hesitate to fall back to SQL. ActiveRecord provides a dozen different places where you can inject smal
by code_duck 15y ago
"Don't try to force it: If you hit something weird, never hesitate to fall back to SQL. ActiveRecord provides a dozen different places where you can inject small SQL fragments into your queries, or you can just call 'find_by_sql' and do everything by hand."
I'm comfortable working like that, but it is exactly what the article is criticizing. Sure, it works - but the whole idea of an ORM was supposed to be avoding that.
- Sapient 15y agoI believe ORMs want to save you from writing tons of repetitive queries, not to save you from ever having to touch a line of SQL. At least that is what I believe, I have never seen an ORM advertising itself with "NEVER WRITE ANOTHER LINE OF SQL AGAIN".
- deleted 15y ago[deleted]
- jimktrains2 15y agoNo, the idea behind an ORM is to make the common case easy and safe.
- davesims 15y ago"But the whole idea of an ORM was supposed to be avoding that." Maybe some ORM zealots said that in the past, but that certainly isn't the common conception now. ORMs as they're actually used properly today allow devs who know SQL really well to eliminate code dup. If you can't drop into SQL quickly, stay away from ORMs, you're going to hurt yourself and others.