Hi, I am using Postgrex and have a little question:
Need to make a Select with IN statement,
sql = "select id,name from fields where id in(1,3) ;" # this work good
But :
sql = "select id,name from fields where id in($1) ;"
Postgrex.query!(pid, sql, [[1,3]]) # Postgrex expected an integer in ...
Postgrex.query!(pid, sql, [{1,3}]) # Postgrex expected an integer in ...
Postgrex.query!(pid, sql, [3]) # this work but is only one.
How must to pack the items ?
in python work with tuple,
in node pg-promise work with a modifier like “items::csv”
Sure it will be silly but the documentation is minimal.
Greetings