5 ms·
Maybe we should treat SQL like JavaScript, and use it as a compiler target instead of coding in it directly. /s
by mordechai9000 4y ago
Maybe we should treat SQL like JavaScript, and use it as a compiler target instead of coding in it directly. /s
- ilkhan4 4y agoI mean, that's pretty much what ORMs do, right? Hasura et al too.
- mordechai9000 4y agoYes, this is true. Although my experience with ORMs is that there is always a reason to use some kind of escape hatch to run raw SQL directly.
- scrozart 4y agoAgreed. After spending the better part of a decade watching Hibernate a) fail to scale or b) get confused beyond a third level of association, I find myself writing bare SQL and/or refactoring to implement the repository model. ORMs are great for prototyping or if your data model is simple; beyond that you're better off without them.
- randomdata 4y agoMost higher level regular programming languages will allow you to escape to C, and C allows you to escape to assembly, so that's not unusual. In my experience when you need to escape to raw SQL there is still some kind of query builder employed, which too becomes another "compile to SQL" source.
- dagss 4y agoNot sure why you added /s; .. SQL is in many ways exactly lile JavaScript. The only way to run your code where it needs to run, but with some things to be desired language wise. I wish more languages compiling to SQL were more common. (Not ORMs though they just miss the point entirely..)
- qorrect 4y agoI know you're being sarcastic, but yes!
- deleted 4y ago[deleted]