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