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.
Files changed (2) hide show
  1. package/index.js +4 -0
  2. 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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_mysql",
3
- "version": "2.3.9",
3
+ "version": "2.4.0",
4
4
  "description": "这是超级美眉mysql帮助函数模块,用于便捷操作mysql,使用await方式,可以避免嵌套函数",
5
5
  "main": "index.js",
6
6
  "dependencies": {