@pi-r/mariadb 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.
Files changed (2) hide show
  1. package/client/index.js +9 -7
  2. package/package.json +4 -4
package/client/index.js CHANGED
@@ -70,6 +70,7 @@ function setAuthentication(credential) {
70
70
  }
71
71
  exports.setAuthentication = setAuthentication;
72
72
  function setCredential(item) {
73
+ var _a, _b, _c, _d, _e, _f;
73
74
  let credential = this.getCredential(item);
74
75
  if (credential) {
75
76
  setAuthentication.call(this, credential);
@@ -124,22 +125,22 @@ function setCredential(item) {
124
125
  if (config) {
125
126
  const { min, max, idle, queue_idle, timeout, socket_timeout } = config;
126
127
  if (min >= 0) {
127
- credential.minimumIdle ?? (credential.minimumIdle = min);
128
+ (_a = credential.minimumIdle) !== null && _a !== void 0 ? _a : (credential.minimumIdle = min);
128
129
  }
129
130
  if (max > 0) {
130
- credential.connectionLimit ?? (credential.connectionLimit = max);
131
+ (_b = credential.connectionLimit) !== null && _b !== void 0 ? _b : (credential.connectionLimit = max);
131
132
  }
132
133
  if (idle >= 0) {
133
- credential.idleTimeout ?? (credential.idleTimeout = idle);
134
+ (_c = credential.idleTimeout) !== null && _c !== void 0 ? _c : (credential.idleTimeout = idle);
134
135
  }
135
136
  if (queue_idle > 0) {
136
- credential.acquireTimeout ?? (credential.acquireTimeout = queue_idle);
137
+ (_d = credential.acquireTimeout) !== null && _d !== void 0 ? _d : (credential.acquireTimeout = queue_idle);
137
138
  }
138
139
  if (timeout > 0) {
139
- credential.connectTimeout ?? (credential.connectTimeout = timeout);
140
+ (_e = credential.connectTimeout) !== null && _e !== void 0 ? _e : (credential.connectTimeout = timeout);
140
141
  }
141
142
  if (socket_timeout > 0) {
142
- credential.socketTimeout ?? (credential.socketTimeout = socket_timeout);
143
+ (_f = credential.socketTimeout) !== null && _f !== void 0 ? _f : (credential.socketTimeout = socket_timeout);
143
144
  }
144
145
  }
145
146
  const poolKey = getPoolKey(credential);
@@ -155,6 +156,7 @@ async function executeQuery(item, options) {
155
156
  }
156
157
  exports.executeQuery = executeQuery;
157
158
  async function executeBatchQuery(batch, options = '', outResult) {
159
+ var _a;
158
160
  const length = batch.length;
159
161
  if (length === 0) {
160
162
  return [];
@@ -237,7 +239,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
237
239
  item.transactionState &= ~64;
238
240
  return client;
239
241
  };
240
- if (this.host?.username) {
242
+ if ((_a = this.host) === null || _a === void 0 ? void 0 : _a.username) {
241
243
  this.applyCommand(...batch);
242
244
  }
243
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.6",
3
+ "version": "0.6.8",
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.7",
25
- "@e-mc/types": "^0.8.7",
26
- "mariadb": "^3.3.0"
24
+ "@e-mc/db": "^0.8.14",
25
+ "@e-mc/types": "^0.8.14",
26
+ "mariadb": "^3.3.1"
27
27
  }
28
28
  }