I want to run a PostgreSQL database query command with condition OR to filter object by an ID Array.
var id_arr = [1, 2, 3]
Result I want to get:
SELECT * FROM auth_user WHERE id = 1 OR id = 2 OR id = 3
I tried but it gets syntax error:
var querydb = `SELECT * FROM auth_user WHERE ` + for (var i of id) { return id = i } + 'OR'
How can I write this code?