update SQLEasy module )add '?' support

This commit is contained in:
FullGreaM 2022-01-12 08:04:24 +03:00
parent 8b2b906d47
commit 0cec684f4e

View File

@ -125,8 +125,12 @@ class database {
this.getBase(table);
let equal_index = '';
let equal_values = '';
let value_array = new Array();
for(let key in index){
equal_index = `${key} = ${this.ToString(index[key])}`;
// equal_index = `${key} = ${this.ToString(index[key])}`;
equal_index = `${key} = ?`;
value_array.push(index[key]);
break;
}
for(let key in values){
@ -135,7 +139,7 @@ class database {
}
let SQLRequest = `UPDATE ${table} SET ${equal_values} WHERE ${equal_index}`;
try {
this.db.prepare(SQLRequest).run();
this.db.prepare(SQLRequest).get(value_array).run();
} catch(err) {
throw new Error(`SQLEasy error: ${err.message}`);
}