I had my own take on this concept[1], though with considerably less language magic involved. I imagine there's a lot of these kind of things running around. My criteria were:
a) let me write actual SQL, not a python DSL that generates SQL
b) be placeholder-safe
c) be composable
Though it was somewhat intentionally limited to what I needed to support for my own needs at the time.
a) let me write actual SQL, not a python DSL that generates SQL
b) be placeholder-safe
c) be composable
Though it was somewhat intentionally limited to what I needed to support for my own needs at the time.
[1] https://github.com/bdowning/sql-athame