-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
Description
When using the format function to prepare a statement, if the data is an object, it is returning [object object] instead of stringifying the object.
for example:
const sqlStr = require(sqlstring);
let query = "INSERT INTO table (cola, colb, colc) VALUES ?";
let data = [["text",0,{test1: "text", val1: 1 }]];
let pquery = sqlStr.format(query,data);
Here is what sqlStr.format returns: "INSERT INTO table (cola, colb, colc) VALUES ('text',0,'[object Object]')"
Here is what it SHOULD return:
"INSERT INTO table (cola, colb, colc) VALUES ('text',0,'{"test1":"text","val1":1}')