Closed
Description
Heya, how would one go about passing parameters to a query with IN
?
For example:
SELECT *
FROM people
WHERE name in ($1)
I've tried to use:
pg.query(query, [['drake', 'zoey']], cb)
But I don't get results back when both drake
and zoey
are in the table.
However the following does seem to work:
pg.query(query.replace(/\$1/, ['drake', 'zoey'].map(v => `'${v}'`).join(','), cb)