@pi-r/mysql 0.6.6 → 0.6.8
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 +8 -6
- package/package.json +4 -4
package/client/index.js
CHANGED
|
@@ -78,6 +78,7 @@ function setAuthentication(credential) {
|
|
|
78
78
|
}
|
|
79
79
|
exports.setAuthentication = setAuthentication;
|
|
80
80
|
function setCredential(item) {
|
|
81
|
+
var _a, _b, _c, _d, _e;
|
|
81
82
|
let credential = this.getCredential(item);
|
|
82
83
|
if (credential) {
|
|
83
84
|
setAuthentication.call(this, credential);
|
|
@@ -104,7 +105,7 @@ function setCredential(item) {
|
|
|
104
105
|
}
|
|
105
106
|
let username, password, pool;
|
|
106
107
|
if ((0, types_1.isString)(usePool)) {
|
|
107
|
-
if (username = credential.user || credential.uri && (0, util_1.parseConnectionString)(credential.uri)
|
|
108
|
+
if (username = credential.user || credential.uri && ((_a = (0, util_1.parseConnectionString)(credential.uri)) === null || _a === void 0 ? void 0 : _a.username)) {
|
|
108
109
|
[password, pool] = DbPool.validateKey(POOL_STATE, username, usePool);
|
|
109
110
|
if (pool) {
|
|
110
111
|
pool.add(item, password);
|
|
@@ -120,16 +121,16 @@ function setCredential(item) {
|
|
|
120
121
|
if (config) {
|
|
121
122
|
const { max, idle, queue_max, timeout } = config;
|
|
122
123
|
if (max > 0) {
|
|
123
|
-
credential.connectionLimit
|
|
124
|
+
(_b = credential.connectionLimit) !== null && _b !== void 0 ? _b : (credential.connectionLimit = max);
|
|
124
125
|
}
|
|
125
126
|
if (idle >= 0) {
|
|
126
|
-
credential.idleTimeout
|
|
127
|
+
(_c = credential.idleTimeout) !== null && _c !== void 0 ? _c : (credential.idleTimeout = idle);
|
|
127
128
|
}
|
|
128
129
|
if (queue_max >= 0) {
|
|
129
|
-
credential.queueLimit
|
|
130
|
+
(_d = credential.queueLimit) !== null && _d !== void 0 ? _d : (credential.queueLimit = queue_max);
|
|
130
131
|
}
|
|
131
132
|
if (timeout > 0) {
|
|
132
|
-
credential.connectTimeout
|
|
133
|
+
(_e = credential.connectTimeout) !== null && _e !== void 0 ? _e : (credential.connectTimeout = timeout);
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
const poolKey = getPoolKey(credential);
|
|
@@ -145,6 +146,7 @@ async function executeQuery(item, options) {
|
|
|
145
146
|
}
|
|
146
147
|
exports.executeQuery = executeQuery;
|
|
147
148
|
async function executeBatchQuery(batch, options = '', outResult) {
|
|
149
|
+
var _a;
|
|
148
150
|
const length = batch.length;
|
|
149
151
|
if (length === 0) {
|
|
150
152
|
return [];
|
|
@@ -227,7 +229,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
227
229
|
item.transactionState &= ~64;
|
|
228
230
|
return client;
|
|
229
231
|
};
|
|
230
|
-
if (this.host
|
|
232
|
+
if ((_a = this.host) === null || _a === void 0 ? void 0 : _a.username) {
|
|
231
233
|
this.applyCommand(...batch);
|
|
232
234
|
}
|
|
233
235
|
for (let i = 0, mysql2Client, mysql2Credential; i < length; ++i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mysql",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.8",
|
|
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.8.
|
|
25
|
-
"@e-mc/types": "^0.8.
|
|
26
|
-
"mysql2": "^3.
|
|
24
|
+
"@e-mc/db": "^0.8.14",
|
|
25
|
+
"@e-mc/types": "^0.8.14",
|
|
26
|
+
"mysql2": "^3.10.3"
|
|
27
27
|
}
|
|
28
28
|
}
|