@pi-r/mssql 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 -8
  2. package/package.json +3 -3
package/client/index.js CHANGED
@@ -110,11 +110,12 @@ function convertType(sql, type, value, options) {
110
110
  }
111
111
  }
112
112
  function getPoolKey(credential) {
113
- const auth = credential.authentication?.options;
114
- if (!credential.server || !(auth?.userName && auth.password)) {
113
+ var _a, _b;
114
+ const auth = (_a = credential.authentication) === null || _a === void 0 ? void 0 : _a.options;
115
+ if (!credential.server || !((auth === null || auth === void 0 ? void 0 : auth.userName) && auth.password)) {
115
116
  return;
116
117
  }
117
- const tls = credential.options?.cryptoCredentialsDetails;
118
+ const tls = (_b = credential.options) === null || _b === void 0 ? void 0 : _b.cryptoCredentialsDetails;
118
119
  if (tls) {
119
120
  if (!(0, types_1.isObject)(tls)) {
120
121
  delete credential.options.cryptoCredentialsDetails;
@@ -137,6 +138,7 @@ function getPoolKey(credential) {
137
138
  }
138
139
  const isOutputParameters = (params) => (0, types_1.isPlainObject)(params) && Object.keys(params).length === 2 && 'input' in params && 'output' in params;
139
140
  function setCredential(item) {
141
+ var _a, _b, _c, _d;
140
142
  let credential = this.getCredential(item), hostname, username, password, port, database;
141
143
  if (credential) {
142
144
  ({ username, password, hostname, port, database } = (0, util_1.parseServerAuth)(credential, true));
@@ -221,16 +223,16 @@ function setCredential(item) {
221
223
  if (config) {
222
224
  const { min, max, idle, queue_idle } = config;
223
225
  if (min >= 0) {
224
- poolConfig.min ?? (poolConfig.min = min);
226
+ (_a = poolConfig.min) !== null && _a !== void 0 ? _a : (poolConfig.min = min);
225
227
  }
226
228
  if (max > 0) {
227
- poolConfig.max ?? (poolConfig.max = max);
229
+ (_b = poolConfig.max) !== null && _b !== void 0 ? _b : (poolConfig.max = max);
228
230
  }
229
231
  if (idle >= 0) {
230
- poolConfig.idleTimeout ?? (poolConfig.idleTimeout = idle);
232
+ (_c = poolConfig.idleTimeout) !== null && _c !== void 0 ? _c : (poolConfig.idleTimeout = idle);
231
233
  }
232
234
  if (queue_idle >= 0) {
233
- poolConfig.acquireTimeout ?? (poolConfig.acquireTimeout = queue_idle);
235
+ (_d = poolConfig.acquireTimeout) !== null && _d !== void 0 ? _d : (poolConfig.acquireTimeout = queue_idle);
234
236
  }
235
237
  }
236
238
  const poolKey = getPoolKey(credential);
@@ -246,6 +248,7 @@ async function executeQuery(item, options) {
246
248
  }
247
249
  exports.executeQuery = executeQuery;
248
250
  async function executeBatchQuery(batch, options = '', outResult) {
251
+ var _a;
249
252
  const length = batch.length;
250
253
  if (length === 0) {
251
254
  return [];
@@ -335,7 +338,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
335
338
  item.transactionState &= ~64;
336
339
  return client;
337
340
  };
338
- if (this.host?.username) {
341
+ if ((_a = this.host) === null || _a === void 0 ? void 0 : _a.username) {
339
342
  this.applyCommand(...batch);
340
343
  }
341
344
  for (let i = 0; i < length; ++i) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/mssql",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "MSSQL 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
  "tedious": "^16.7.1",
27
27
  "tedious-connection-pool2": "^2.1.0"
28
28
  }