mm_mysql 2.3.9 → 2.4.0
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/index.js +4 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -207,11 +207,13 @@ Mysql.prototype.run = async function (sql, params = []) {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
this.error = null;
|
|
210
|
+
this.sql = '';
|
|
210
211
|
let conn = null;
|
|
211
212
|
let ret = [];
|
|
212
213
|
try {
|
|
213
214
|
// 获取连接
|
|
214
215
|
conn = await this.getConn();
|
|
216
|
+
this.sql = sql;
|
|
215
217
|
let [rows] = await conn.query(sql, params);
|
|
216
218
|
ret = rows;
|
|
217
219
|
} catch (err) {
|
|
@@ -243,11 +245,13 @@ Mysql.prototype.exec = async function (sql, params = []) {
|
|
|
243
245
|
throw new TypeError('params must be array');
|
|
244
246
|
}
|
|
245
247
|
this.error = null;
|
|
248
|
+
this.sql = '';
|
|
246
249
|
let conn = null;
|
|
247
250
|
let ret = 0;
|
|
248
251
|
try {
|
|
249
252
|
// 获取连接
|
|
250
253
|
conn = await this.getConn();
|
|
254
|
+
this.sql = sql;
|
|
251
255
|
let [result] = await conn.execute(sql, params);
|
|
252
256
|
ret = result.insertId || result.affectedRows || result.changedRows || 1;
|
|
253
257
|
} catch (error) {
|