2 ms·
Doing it the other way around makes more sense, i.e. write SQL to generate code. See https://github.com/kyleconroy/sqlc https://github.com/kyleconroy/sqlc, why
by mozey 5y ago
Doing it the other way around makes more sense, i.e. write SQL to generate code. See https://github.com/kyleconroy/sqlc https://github.com/kyleconroy/sqlc, why aren't more people following this approach?
- rrrrrrrrrrrryan 5y agoThis is awesome. Composing a SQL query is often the easiest part. The issue is that throwing that static SELECT statement string in your code has a ton of downsides (as discussed everywhere in this thread). And fiddling with an ORM is tremendously frustrating when you're just trying to get it to compose the SQL you've already written in your head. For a dev who's bothered to learn SQL, flipping the thing on its head makes a ton of sense.