mm_mysql 2.4.5 → 2.4.7
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/package.json +6 -6
- package/sql.js +4 -4
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_mysql",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.7",
|
|
4
4
|
"description": "这是超级美眉mysql帮助函数模块,用于便捷操作mysql,使用await方式,可以避免嵌套函数",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"mm_expand": "^2.3
|
|
8
|
-
"mysql2": "^3.22.
|
|
7
|
+
"mm_expand": "^2.4.3",
|
|
8
|
+
"mysql2": "^3.22.5",
|
|
9
9
|
"sqlstring": "^2.3.3"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"node": ">=12.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"eslint": "^10.
|
|
40
|
-
"eslint-plugin-jsdoc": "^63.0.
|
|
41
|
-
"mm_eslint": "^1.7.
|
|
39
|
+
"eslint": "^10.6.0",
|
|
40
|
+
"eslint-plugin-jsdoc": "^63.0.10",
|
|
41
|
+
"mm_eslint": "^1.7.5"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/sql.js
CHANGED
|
@@ -1180,7 +1180,7 @@ Sql.prototype.tplBody = function (param_dt, sql_dt) {
|
|
|
1180
1180
|
let parts = [];
|
|
1181
1181
|
if (!sql_dt || Object.keys(sql_dt).length === 0) {
|
|
1182
1182
|
for (let key in param_dt) {
|
|
1183
|
-
parts.push(
|
|
1183
|
+
parts.push(escapeId(key) + ' = ' + escape(param_dt[key]));
|
|
1184
1184
|
}
|
|
1185
1185
|
} else {
|
|
1186
1186
|
for (let key in param_dt) {
|
|
@@ -1188,13 +1188,13 @@ Sql.prototype.tplBody = function (param_dt, sql_dt) {
|
|
|
1188
1188
|
if (sql_dt[key]) {
|
|
1189
1189
|
// 使用直接替换方式,避免模板替换错误
|
|
1190
1190
|
let replaced = sql_dt[key].replaceAll('{0}', value.trim("'"));
|
|
1191
|
-
parts.push(
|
|
1191
|
+
parts.push(replaced.replace(/\+ -/g, '- ').replace(/- -/g, '+ '));
|
|
1192
1192
|
} else {
|
|
1193
|
-
parts.push(
|
|
1193
|
+
parts.push(escapeId(key) + ' = ' + value);
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
1196
|
}
|
|
1197
|
-
return parts.join(',
|
|
1197
|
+
return parts.join(', ');
|
|
1198
1198
|
};
|
|
1199
1199
|
|
|
1200
1200
|
/**
|