multi-db-orm 2.1.24 → 2.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/engines/mysqldb.js +9 -5
- package/package.json +1 -1
package/engines/mysqldb.js
CHANGED
|
@@ -163,7 +163,7 @@ class MySQLDB extends MultiDbORM {
|
|
|
163
163
|
else if (typeof val == 'boolean')
|
|
164
164
|
vals = vals + `${val},`;
|
|
165
165
|
else
|
|
166
|
-
vals = vals +
|
|
166
|
+
vals = vals + `${val},`;
|
|
167
167
|
}
|
|
168
168
|
cols = cols.substring(0, cols.length - 1);
|
|
169
169
|
vals = vals.substring(0, vals.length - 1);
|
|
@@ -199,18 +199,22 @@ class MySQLDB extends MultiDbORM {
|
|
|
199
199
|
|
|
200
200
|
if ( val == "undefined" || val == undefined || val == 'null'|| val == null)
|
|
201
201
|
vals = vals + `${key} = Null,`;
|
|
202
|
-
else if (typeof val == 'object')
|
|
203
|
-
val = vals + `${key} = '${JSON.stringify(object[key])}',`
|
|
204
202
|
else if (typeof val == 'boolean')
|
|
205
203
|
vals = vals + `${key} = ${val},`;
|
|
206
204
|
else
|
|
207
|
-
vals = vals + `${key} =
|
|
205
|
+
vals = vals + `${key} = ${val},`;
|
|
208
206
|
}
|
|
209
207
|
where = where + " 1 ";
|
|
210
208
|
vals = vals.substring(0, vals.length - 1);
|
|
211
209
|
|
|
212
210
|
var query = `UPDATE ${modelname} SET ${vals} WHERE ${where};`;
|
|
213
|
-
|
|
211
|
+
try{
|
|
212
|
+
return await this.run(query);
|
|
213
|
+
}catch(e){
|
|
214
|
+
if(this.loglevel > 4)
|
|
215
|
+
console.log('Error in update',e)
|
|
216
|
+
throw e;
|
|
217
|
+
}
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
async delete(modelname, filter) {
|