Re:Show HN: Inline SQL in any Python program
by orf on Saturday October 08, 2022 @05:08PM
(#33136024)
These are good points, especially around the magic substitution. I hadn’t really considered that.
Even so, pandas has the same magic substitution going on with just a standard function call, and it’s somewhat intuitive.
However, regardless of the syntax nitpicking, this is a cool project. Nice one!
We could use a standard function application, but that doesn't convey the point that there's some DSL embedding going on here, such as variable substitution from the outside scope. It's also less nice to end multi-line queries with the string: """).
Other reasons: the bitwise XOR operator is almost never used in Python, so it's highly unlikely that people would confuse it as such (this is also why it's formatted without a space before the operator). Open to other proposals for syntax though.