Repro:
sqlite.run('CREATE TABLE IF NOT EXISTS things(id INTEGER PRIMARY KEY, word STR, things INT)');
sqlite.run("INSERT INTO things(id, word, things) VALUES (?, ?, ?)",[1, "???", 10]);
Expected: "INSERT INTO things(id, word, things) VALUES (1, '???', 10)"
Actual: "INSERT INTO things(id, word, things) VALUES (1, '10??', ?)"
Seems to be an issue due to the prevalance of this loop (e.g. sqlite.js line 233):
if(data){
for(var i = 0 ; i < data.length; i++){
sql = sql.replace('?',"'"+data[i]+"'");
}
}
Repro: sqlite.run('CREATE TABLE IF NOT EXISTS things(id INTEGER PRIMARY KEY, word STR, things INT)'); sqlite.run("INSERT INTO things(id, word, things) VALUES (?, ?, ?)",[1, "???", 10]);
Expected: "INSERT INTO things(id, word, things) VALUES (1, '???', 10)" Actual: "INSERT INTO things(id, word, things) VALUES (1, '10??', ?)"
Seems to be an issue due to the prevalance of this loop (e.g. sqlite.js line 233): if(data){ for(var i = 0 ; i < data.length; i++){ sql = sql.replace('?',"'"+data[i]+"'"); } }