This is awesome. Is there a way to get it to work with e.g. dataclasses-sql? I am thinking of something such as<p><pre><code> stuff: list[mydataclass]
sql_val^ "select * from stuff where stuff.field = 2"
</code></pre>
over any kind of 'fmappable' container; perhaps eg.<p><pre><code> stuff: dict[int, mydataclass]
stuff2: dict[int, mydataclass]
sql_val^ "select (s2.val, s.key) from stuff as s, stuff2 as s2 where s.key > s2.key and s2.value != s.value)"
</code></pre>
etc
Very cool, I have lots of ideas of how to leverage it for windmill.dev. We were using psycopg2 for all our examples but this is much cleaner. Thanks for sharing!
Something was not clear to me from the README. When you do string interpolations as in your examples, those are actually prepared sql statements right ? Otherwise it would open the way for sql injections.