Re:Show HN: Csql – Python lib for composeable SQL queries
by ramraj07 on Friday October 23, 2020 @03:16AM
(#24866811)
Have you tried dbt? Even if you don't want to adapt their "all in SQL" idea, I definitely took inspiration from their Jinja templating idea and have similar libraries as you, except it uses Jinja templating to parameterize the SQL. This allows more logic to be put in the queries than just variable names!
[ Parent
| on HN ]
Re:Show HN: Csql – Python lib for composeable SQL queries
by akdor1154 on Friday October 23, 2020 @04:11AM
(#24867097)
Huh, no I haven't come across dbt. Looks interesting! Jinja'd sql scares me a bit, but to be fair the string interpolation in my lib here scares me as well :)
Re:Show HN: Csql – Python lib for composeable SQL queries
by ramraj07 on Friday October 23, 2020 @11:20PM
(#24876691)
Practical experience is that while there are kinks, Jinja and SQL marry fairly well together. Combining this idea and snowflake we have been able to create some extremely versatile metrics reporting systems that run with zero intervention I wouldn't have imagined a year or two back!