How to construct a mysql query:
SELECT *
FROM table
WHERE (key->>"$.k1", key->>"$.k2") IN ((1, "string1"), (2, "string2"))
with SQLAlchemy?
I tried to use text
but with no luck:
select([table.c.value]).where(
text('(key->>"$.k1", key->>"$.k2") IN :pairs)').bindparams(
pairs=[(1, "string1"), (2, "string2")]
)
)
This code produced:
SELECT *
FROM table
WHERE (key->>"$.k1", key->>"$.k2") IN NULL