mm_mysql 1.9.3 → 1.9.5
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 +0 -8
- package/package.json +4 -3
- package/test.js +5 -5
package/index.js
CHANGED
|
@@ -90,10 +90,6 @@ class Mysql {
|
|
|
90
90
|
$.log.debug("SQL:", sql);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
if (!$this.conn) {
|
|
94
|
-
$this.open();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
93
|
// 返回一个 Promise
|
|
98
94
|
return new Promise((resolve, reject) => {
|
|
99
95
|
$this.conn.getConnection(function(err, db) {
|
|
@@ -159,10 +155,6 @@ class Mysql {
|
|
|
159
155
|
$.log.debug("SQL:", sql);
|
|
160
156
|
}
|
|
161
157
|
|
|
162
|
-
if (!$this.conn) {
|
|
163
|
-
$this.open();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
158
|
// 返回一个 Promise
|
|
167
159
|
return new Promise((resolve, reject) => {
|
|
168
160
|
$this.conn.getConnection(function(err, db) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_mysql",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.5",
|
|
4
4
|
"description": "这是超级美眉mysql帮助函数模块,用于便捷操作mysql,使用await方式,可以避免嵌套函数",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"mm_expand": "^1.8.0",
|
|
8
|
-
"mm_logs": "^1.1.7"
|
|
8
|
+
"mm_logs": "^1.1.7",
|
|
9
|
+
"mysql": "^2.18.1"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
12
|
"test": "node test.js",
|
|
@@ -30,4 +31,4 @@
|
|
|
30
31
|
],
|
|
31
32
|
"author": "qww",
|
|
32
33
|
"license": "ISC"
|
|
33
|
-
}
|
|
34
|
+
}
|
package/test.js
CHANGED
|
@@ -13,13 +13,13 @@ async function test() {
|
|
|
13
13
|
password: "Asd159357",
|
|
14
14
|
multipleStatements: true
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
await sql.open();
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
db = sql.db();
|
|
19
|
+
db.table = 'user_account';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
var obj = await db.getObj();
|
|
22
|
+
console.log(obj);
|
|
23
23
|
|
|
24
24
|
// // 导入
|
|
25
25
|
// var ret = await sql.load("./data.sql".fullname(__dirname), function(progress, index, error, sql_str) {
|