@pi-r/oracle 0.6.6 → 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.
Files changed (2) hide show
  1. package/client/index.js +11 -9
  2. package/package.json +3 -3
package/client/index.js CHANGED
@@ -89,20 +89,21 @@ function initOracleClient(credential, type) {
89
89
  this.addLog(this.statusType.WARN, err, 'oracledb', credential.libDir);
90
90
  break;
91
91
  default:
92
- this.writeFail(["Unable to configure client", 'oracledb'], err, { type: type ?? 65536, fatal: false });
92
+ this.writeFail(["Unable to configure client", 'oracledb'], err, { type: type !== null && type !== void 0 ? type : 65536, fatal: false });
93
93
  break;
94
94
  }
95
95
  }
96
96
  }
97
97
  }
98
98
  else {
99
- this.writeFail(["Unable to configure client", 'oracledb'], (0, types_1.errorMessage)('oracledb', 'Environment variable "NODE_ORACLEDB_DRIVER_MODE" was not set', 'thick'), { type: type ?? 65536, fatal: false });
99
+ this.writeFail(["Unable to configure client", 'oracledb'], (0, types_1.errorMessage)('oracledb', 'Environment variable "NODE_ORACLEDB_DRIVER_MODE" was not set', 'thick'), { type: type !== null && type !== void 0 ? type : 65536, fatal: false });
100
100
  }
101
101
  delete credential.libDir;
102
102
  }
103
103
  }
104
104
  exports.initOracleClient = initOracleClient;
105
105
  async function setCredential(item) {
106
+ var _a, _b, _c, _d, _e, _f;
106
107
  let credential = this.getCredential(item), hostname, port, username, database;
107
108
  if (credential) {
108
109
  ({ hostname, port, username } = (0, util_1.parseServerAuth)(credential));
@@ -191,22 +192,22 @@ async function setCredential(item) {
191
192
  if (config) {
192
193
  const { min, max, idle, queue_max, queue_idle, timeout } = config;
193
194
  if (min >= 0) {
194
- credential.poolMin ?? (credential.poolMin = min);
195
+ (_a = credential.poolMin) !== null && _a !== void 0 ? _a : (credential.poolMin = min);
195
196
  }
196
197
  if (max > 0) {
197
- credential.poolMax ?? (credential.poolMax = max);
198
+ (_b = credential.poolMax) !== null && _b !== void 0 ? _b : (credential.poolMax = max);
198
199
  }
199
200
  if (idle >= 0) {
200
- credential.poolTimeout ?? (credential.poolTimeout = idle / 1000);
201
+ (_c = credential.poolTimeout) !== null && _c !== void 0 ? _c : (credential.poolTimeout = idle / 1000);
201
202
  }
202
203
  if (queue_max >= 0) {
203
- credential.queueMax ?? (credential.queueMax = queue_max);
204
+ (_d = credential.queueMax) !== null && _d !== void 0 ? _d : (credential.queueMax = queue_max);
204
205
  }
205
206
  if (queue_idle >= 0) {
206
- credential.queueTimeout ?? (credential.queueTimeout = queue_idle);
207
+ (_e = credential.queueTimeout) !== null && _e !== void 0 ? _e : (credential.queueTimeout = queue_idle);
207
208
  }
208
209
  if (timeout >= 0) {
209
- credential.connectTimeout ?? (credential.connectTimeout = idle / 1000);
210
+ (_f = credential.connectTimeout) !== null && _f !== void 0 ? _f : (credential.connectTimeout = idle / 1000);
210
211
  }
211
212
  }
212
213
  const poolKey = getPoolKey(credential);
@@ -222,6 +223,7 @@ async function executeQuery(item, options) {
222
223
  }
223
224
  exports.executeQuery = executeQuery;
224
225
  async function executeBatchQuery(batch, options = '', outResult) {
226
+ var _a;
225
227
  const length = batch.length;
226
228
  if (length === 0) {
227
229
  return [];
@@ -298,7 +300,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
298
300
  item.transactionState &= ~64;
299
301
  return client;
300
302
  };
301
- if (this.host?.username) {
303
+ if ((_a = this.host) === null || _a === void 0 ? void 0 : _a.username) {
302
304
  this.applyCommand(...batch);
303
305
  }
304
306
  for (let i = 0; i < length; ++i) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/oracle",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Oracle 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",
24
+ "@e-mc/db": "^0.8.8",
25
+ "@e-mc/types": "^0.8.8",
26
26
  "oracledb": "^6.4.0"
27
27
  }
28
28
  }