Closed karolpiernikarz closed 1 year ago
question mark correspond to parameters. if you need some part of query to be build from variables, better to use Template literals, like:
await sqlConnection.query(
UPDATE MyTable SET ${sqlConnection.escapeId(updateObject)} WHERE id=?, [id]);
this way, updateObject is properly escaped, and parameter is at his place
I have a question regarding the following UPDATE statement. Is this actually possible? If not, can you please suggest a solution?
await sqlConnection.query('UPDATE MyTable SET ? WHERE id='${id}'', updateObject);