When executing :
await conn.fetch("SELECT * FROM table WHERE field IN ($1)", tuple_parameter)
Let say that field is an integer field.
It complains that the parameter type is "tuple" instead of "int".
Ty
Hello,
thank you for your answer. I've tested your suggested solution and it
works :)
nonetheless, the clause "filed IN (values)" seems valid in Postgresql :
cf 搂9.23.1 in
https://www.postgresql.org/docs/9.5/static/functions-comparisons.html
furthermore, before unsing asyncpg, I used psycopg2 + aiopg and I used
the in_ operator provided by SqlAlchemy. The query converted to str
contained the 'IN'.
anyway, I got a solution and that's the best.
Franck
On 2017-07-20 14:50, Yury Selivanov wrote:
https://magicstack.github.io/asyncpg/current/faq.html [1]
--
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub [2], or mute the
thread [3].*
Links:
[1] https://magicstack.github.io/asyncpg/current/faq.html
[2]
https://github.com/MagicStack/asyncpg/issues/175#issuecomment-316692683
[3]
https://github.com/notifications/unsubscribe-auth/AB0GtawOJ1vj3-zsSYotH43OUAJ4UMFqks5sP0z6gaJpZM4OeC04
For people reading this issue too quickly like me: what's invalid is not expression in (values), but expression in $1, where $1 is a native var.
Most helpful comment
Hello,
thank you for your answer. I've tested your suggested solution and it
works :)
nonetheless, the clause "filed IN (values)" seems valid in Postgresql :
cf 搂9.23.1 in
https://www.postgresql.org/docs/9.5/static/functions-comparisons.html
furthermore, before unsing asyncpg, I used psycopg2 + aiopg and I used
the in_ operator provided by SqlAlchemy. The query converted to str
contained the 'IN'.
anyway, I got a solution and that's the best.
Franck
On 2017-07-20 14:50, Yury Selivanov wrote: