@pi-r/mysql 0.10.3 → 0.11.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/client/index.js +9 -11
- package/package.json +4 -4
package/client/index.js
CHANGED
|
@@ -97,13 +97,16 @@ function setCredential(item) {
|
|
|
97
97
|
}
|
|
98
98
|
const config = this.getPoolConfig("mysql", password);
|
|
99
99
|
if (config) {
|
|
100
|
-
const { max, idle, queue_max, timeout } = config;
|
|
100
|
+
const { max, idle, idle_max, queue_max, timeout } = config;
|
|
101
101
|
if (max > 0) {
|
|
102
102
|
credential.connectionLimit ??= max;
|
|
103
103
|
}
|
|
104
104
|
if (idle >= 0) {
|
|
105
105
|
credential.idleTimeout ??= idle;
|
|
106
106
|
}
|
|
107
|
+
if (idle_max >= 0) {
|
|
108
|
+
credential.maxIdle ??= idle_max;
|
|
109
|
+
}
|
|
107
110
|
if (queue_max >= 0) {
|
|
108
111
|
credential.queueLimit ??= queue_max;
|
|
109
112
|
}
|
|
@@ -173,16 +176,11 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
173
176
|
}
|
|
174
177
|
catch (err) {
|
|
175
178
|
let close;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
close = 1;
|
|
182
|
-
break;
|
|
183
|
-
default:
|
|
184
|
-
close = pool.closeable;
|
|
185
|
-
break;
|
|
179
|
+
if ((0, types_1.isErrorCode)(err, 'ER_ACCESS_DENIED_ERROR', 'ER_DBACCESS_DENIED_ERROR', 'ER_SPECIFIC_ACCESS_DENIED_ERROR', 'ER_ACCESS_DENIED_NO_PASSWORD_ERROR')) {
|
|
180
|
+
close = 1;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
close = pool.closeable;
|
|
186
184
|
}
|
|
187
185
|
if (close) {
|
|
188
186
|
await pool.detach(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mysql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MySQL client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/db": "^0.
|
|
24
|
-
"@e-mc/types": "^0.
|
|
25
|
-
"mysql2": "^3.
|
|
23
|
+
"@e-mc/db": "^0.13.0",
|
|
24
|
+
"@e-mc/types": "^0.13.0",
|
|
25
|
+
"mysql2": "^3.15.2"
|
|
26
26
|
}
|
|
27
27
|
}
|