mssql 12.7.13 → 12.7.15

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.
@@ -12,6 +12,7 @@ const { CHANNELS, tracePromise, traceCallback, publish } = require('../diagnosti
12
12
 
13
13
  const NODE_MSSQL_SCHEMA = {
14
14
  ...MSSQL_SCHEMA,
15
+ encrypt: { type: 'boolean' },
15
16
  useutc: { type: 'boolean' },
16
17
  stream: { type: 'boolean' },
17
18
  parsejson: { type: 'boolean' },
@@ -233,9 +234,11 @@ class ConnectionPool extends EventEmitter {
233
234
  break
234
235
  }
235
236
  case 'encrypt':
236
- Object.assign(config.options, {
237
- encrypt: !!value
238
- })
237
+ if (typeof value === 'boolean') {
238
+ Object.assign(config.options, {
239
+ encrypt: value
240
+ })
241
+ }
239
242
  break
240
243
  case 'enlist':
241
244
  break
@@ -421,7 +424,12 @@ class ConnectionPool extends EventEmitter {
421
424
  return shared.Promise.reject(new ConnectionError('Connection is closing', 'ENOTOPEN'))
422
425
  }
423
426
 
424
- return this.pool.acquire().promise
427
+ return this.pool.acquire().promise.catch(err => {
428
+ if (err instanceof tarn.TimeoutError) {
429
+ err.message = `Failed to acquire a connection from the pool: ${err.message}`
430
+ }
431
+ throw err
432
+ })
425
433
  }
426
434
 
427
435
  /**
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "azure",
22
22
  "node-mssql"
23
23
  ],
24
- "version": "12.7.13",
24
+ "version": "12.7.15",
25
25
  "main": "index.js",
26
26
  "type": "commonjs",
27
27
  "repository": {
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "license": "MIT",
36
36
  "dependencies": {
37
- "@tediousjs/connection-string": "^1.0.0",
37
+ "@tediousjs/connection-string": "^1.1.2",
38
38
  "commander": "^11.0.0",
39
39
  "debug": "^4.3.3",
40
40
  "tarn": "^3.0.2",