DT
Drizzle Team•13mo ago
kornel

inArray() using sql`` operator in JS and Postgres

Hey, how do I use sql operator with arrays in JS?
const array = [1,2,3];
const sqlQuery = sql`${users.id} IN ???`;
const array = [1,2,3];
const sqlQuery = sql`${users.id} IN ???`;
2 Replies
karadz.
karadz.•13mo ago
const sqlQuery = sql${users.id} IN ${array}
kornel
kornelOP•13mo ago
🤦 I tried to use it on column that type is array, that's why I had a problem. Thanks.
Want results from more Discord servers?
Add your server