How SqlString.format() works with objects and identifiers
masterThe SqlString.format() method can combine identifier escaping (??), value escaping (?), and object mapping. When an object is passed as a value to .escape() or .format(), SqlString.escapeId() is used internally to escape the object's keys to prevent SQL injection.
Example of using an object for a SET clause:
var post = {id: 1, title: 'Hello MySQL'};
var sql = SqlString.format('INSERT INTO posts SET ?', post);
console.log(sql); // INSERT INTO posts SET `id` = 1, `title` = 'Hello MySQL'