@pi-r/mysql 0.2.10 → 0.2.12
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 +5 -4
- package/package.json +4 -4
package/client/index.js
CHANGED
|
@@ -72,6 +72,7 @@ function setAuthentication(credential) {
|
|
|
72
72
|
}
|
|
73
73
|
exports.setAuthentication = setAuthentication;
|
|
74
74
|
function setCredential(item) {
|
|
75
|
+
var _a, _b, _c, _d;
|
|
75
76
|
let credential = this.getCredential(item);
|
|
76
77
|
if (credential) {
|
|
77
78
|
setAuthentication.call(this, credential);
|
|
@@ -95,7 +96,7 @@ function setCredential(item) {
|
|
|
95
96
|
const usePool = item.usePool;
|
|
96
97
|
if (usePool) {
|
|
97
98
|
let username, password, pool;
|
|
98
|
-
if (typeof usePool === 'string' && (username = credential.user || credential.uri && (0, util_1.parseConnectionString)(credential.uri)
|
|
99
|
+
if (typeof usePool === 'string' && (username = credential.user || credential.uri && ((_a = (0, util_1.parseConnectionString)(credential.uri)) === null || _a === void 0 ? void 0 : _a.username))) {
|
|
99
100
|
[password, pool] = DbPool.validateKey(POOL_STATE, username, usePool);
|
|
100
101
|
if (pool) {
|
|
101
102
|
pool.add(item, password);
|
|
@@ -109,13 +110,13 @@ function setCredential(item) {
|
|
|
109
110
|
if (config) {
|
|
110
111
|
const { max, idle, queue_max } = config;
|
|
111
112
|
if (max > 0) {
|
|
112
|
-
credential.connectionLimit
|
|
113
|
+
(_b = credential.connectionLimit) !== null && _b !== void 0 ? _b : (credential.connectionLimit = max);
|
|
113
114
|
}
|
|
114
115
|
if (idle >= 0) {
|
|
115
|
-
credential.idleTimeout
|
|
116
|
+
(_c = credential.idleTimeout) !== null && _c !== void 0 ? _c : (credential.idleTimeout = idle);
|
|
116
117
|
}
|
|
117
118
|
if (queue_max >= 0) {
|
|
118
|
-
credential.queueLimit
|
|
119
|
+
(_d = credential.queueLimit) !== null && _d !== void 0 ? _d : (credential.queueLimit = queue_max);
|
|
119
120
|
}
|
|
120
121
|
}
|
|
121
122
|
new MySQLPool(createPool(removeUUIDKey(credential)), poolKey, username && password ? { username, password } : undefined).add(item).parent = POOL_STATE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mysql",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "MySQL client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@e-mc/db": "^0.5.
|
|
25
|
-
"@e-mc/types": "^0.5.
|
|
26
|
-
"mysql2": "^3.
|
|
24
|
+
"@e-mc/db": "^0.5.10",
|
|
25
|
+
"@e-mc/types": "^0.5.10",
|
|
26
|
+
"mysql2": "^3.10.3"
|
|
27
27
|
}
|
|
28
28
|
}
|