3 ms·
I don't understand why raw SQL is considered less productive. I bet anything with more than two joins is easier to write in raw SQL than any ORM.
by kebsup 3y ago
I don't understand why raw SQL is considered less productive. I bet anything with more than two joins is easier to write in raw SQL than any ORM.
- fragmede 3y agoSQL is declarative while most other languages are procedural. An ORM lets you pretend that the database speaks a procedural language, which lets you build the query procedurally, which may be easier to write.
- sgarland 3y agoI think Django is roughly the same level of complexity, once you’ve learned its syntax of course. Actually, it may be too easy in some regards (thinking specifically of implicit joins), such that unaware devs may not realize that they’re causing performance issues. In general though, I agree with your premise - I don’t understand why people are so reluctant to learn SQL. It’s not a difficult language. Understanding the quirks of your RDBMS, sure. But the base language? Nah.
- AirMax98 3y agoRaw SQL will probably not give you the type safety of an ORM.
- kebsup 3y agoI use intellij, which gives basic type warnings, plus I generate Typescript types from db, which I assign to the query. I don't know what more could I need. :D