@pi-r/mariadb 0.6.5 → 0.6.7
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 -8
- package/package.json +4 -4
package/client/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
exports.DB_SOURCE_TYPE = exports.DB_SOURCE_CLIENT = exports.checkTimeout = exports.executeBatchQuery = exports.executeQuery = exports.setCredential = exports.setAuthentication = void 0;
|
|
4
3
|
const mariadb = require("mariadb");
|
|
5
4
|
const util_1 = require("@e-mc/db/util");
|
|
@@ -71,6 +70,7 @@ function setAuthentication(credential) {
|
|
|
71
70
|
}
|
|
72
71
|
exports.setAuthentication = setAuthentication;
|
|
73
72
|
function setCredential(item) {
|
|
73
|
+
var _a, _b, _c, _d, _e, _f;
|
|
74
74
|
let credential = this.getCredential(item);
|
|
75
75
|
if (credential) {
|
|
76
76
|
setAuthentication.call(this, credential);
|
|
@@ -125,22 +125,22 @@ function setCredential(item) {
|
|
|
125
125
|
if (config) {
|
|
126
126
|
const { min, max, idle, queue_idle, timeout, socket_timeout } = config;
|
|
127
127
|
if (min >= 0) {
|
|
128
|
-
credential.minimumIdle
|
|
128
|
+
(_a = credential.minimumIdle) !== null && _a !== void 0 ? _a : (credential.minimumIdle = min);
|
|
129
129
|
}
|
|
130
130
|
if (max > 0) {
|
|
131
|
-
credential.connectionLimit
|
|
131
|
+
(_b = credential.connectionLimit) !== null && _b !== void 0 ? _b : (credential.connectionLimit = max);
|
|
132
132
|
}
|
|
133
133
|
if (idle >= 0) {
|
|
134
|
-
credential.idleTimeout
|
|
134
|
+
(_c = credential.idleTimeout) !== null && _c !== void 0 ? _c : (credential.idleTimeout = idle);
|
|
135
135
|
}
|
|
136
136
|
if (queue_idle > 0) {
|
|
137
|
-
credential.acquireTimeout
|
|
137
|
+
(_d = credential.acquireTimeout) !== null && _d !== void 0 ? _d : (credential.acquireTimeout = queue_idle);
|
|
138
138
|
}
|
|
139
139
|
if (timeout > 0) {
|
|
140
|
-
credential.connectTimeout
|
|
140
|
+
(_e = credential.connectTimeout) !== null && _e !== void 0 ? _e : (credential.connectTimeout = timeout);
|
|
141
141
|
}
|
|
142
142
|
if (socket_timeout > 0) {
|
|
143
|
-
credential.socketTimeout
|
|
143
|
+
(_f = credential.socketTimeout) !== null && _f !== void 0 ? _f : (credential.socketTimeout = socket_timeout);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
const poolKey = getPoolKey(credential);
|
|
@@ -156,6 +156,7 @@ async function executeQuery(item, options) {
|
|
|
156
156
|
}
|
|
157
157
|
exports.executeQuery = executeQuery;
|
|
158
158
|
async function executeBatchQuery(batch, options = '', outResult) {
|
|
159
|
+
var _a;
|
|
159
160
|
const length = batch.length;
|
|
160
161
|
if (length === 0) {
|
|
161
162
|
return [];
|
|
@@ -238,7 +239,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
238
239
|
item.transactionState &= ~64;
|
|
239
240
|
return client;
|
|
240
241
|
};
|
|
241
|
-
if (this.host
|
|
242
|
+
if ((_a = this.host) === null || _a === void 0 ? void 0 : _a.username) {
|
|
242
243
|
this.applyCommand(...batch);
|
|
243
244
|
}
|
|
244
245
|
for (let i = 0; i < length; ++i) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mariadb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "MariaDB 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
|
-
"mariadb": "^3.
|
|
24
|
+
"@e-mc/db": "^0.8.8",
|
|
25
|
+
"@e-mc/types": "^0.8.8",
|
|
26
|
+
"mariadb": "^3.3.0"
|
|
27
27
|
}
|
|
28
28
|
}
|