This is my statement:
INSERT INTO userpermissions (username, permission)
VALUES ($1, $2),($3,$4)
RETURNING *;
This is my code:
db.query(stmt2,values2, (err2, result2) => {
//Do other stuff depending on if there is an error or result
}
Where stmt2, is the above statement, and values2 is an array which I create by doing:
var values2 = [];
for(i=0;i<permissions.length;i++){
values2.push(username);
values2.push(permissions[i]);
}
There is some kind of error / fatal exception, but I can't see it because the domain of the error is wrapped.