mm_mysql 1.7.6 → 1.7.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/sql.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_mysql",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "这是超级美眉mysql帮助函数模块,用于便捷操作mysql,使用await方式,可以避免嵌套函数",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/sql.js CHANGED
@@ -275,7 +275,7 @@ Sql.prototype.addOrSetSql = async function(where, set, like) {
275
275
  }
276
276
  } else {
277
277
  for (var k in set) {
278
- key += "," + k;
278
+ key += "," + escapeId(k);
279
279
  var val = set[k];
280
280
  if (val && typeof(val) === "string") {
281
281
  val = val.trim("'");
@@ -285,6 +285,9 @@ Sql.prototype.addOrSetSql = async function(where, set, like) {
285
285
  }
286
286
  return await this.addSql(key.replace(",", ""), value.replace(",", ""));
287
287
  }
288
+ if (typeof(set) === "object") {
289
+ set = await this.toSet(set);
290
+ }
288
291
  return await this.setSql(where, set);
289
292
  };
290
293