Re:Write an SQL query builder in 150 lines of Python
by mozey on Friday August 27, 2021 @10:30AM
(#28328259)
Doing it the other way around makes more sense, i.e. write SQL to generate code. See https://github.com/kyleconroy/sqlc, why aren't more people following this approach?
[ Parent
| on HN ]
Re:Write an SQL query builder in 150 lines of Python
by rrrrrrrrrrrryan on Friday August 27, 2021 @05:43PM
(#28333280)
This 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.