-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
I apologize if there was an update that caused this and I missed it, but suddenly (using node-postgres version 6.1.5) the following query doesn't work when it used to pretty recently:
import { Pool } from 'pg'
const pool = new Pool(config)
const { rows } = await pool.query('SELECT * FROM table WHERE id IN ($1)', [[1,2,3]]
I get the following error, which I haven't gotten in the past:
error: invalid input syntax for integer: "{"1","2","3"}"
I also tried the following which isn't working either:
const { rows } = await pool.query('SELECT * FROM table WHERE id IN ($1)', [[1,2,3].join(',')]
error: invalid input syntax for integer: "1,2,3"
How do I run a parameterized query using the IN
keyword and provide a list of data as we used to be able to before? Is there documentation on this breaking change somewhere I missed?