Comparing version 7.1.0 to 7.1.1
@@ -0,1 +1,9 @@ | ||
v7.1.1 (2021-06-09) | ||
------------------- | ||
[fix] Errors from tedious connection creation now cause connection promise to | ||
reject ((#1254)[https://github.com/tediousjs/node-mssql/pull/1254]) | ||
[fix] Encrypt and transaction binding settings now respect value parsed from | ||
connection strings | ||
((#1252)[https://github.com/tediousjs/node-mssql/pull/1252) | ||
v7.1.0 (2021-05-13) | ||
@@ -12,3 +20,3 @@ ------------------- | ||
[new] Connection validation checks before releasing connections from the pool. This can be turned of via `validateConnection: false` config option ([#1192](https://github.com/tediousjs/node-mssql/pull/1192)) | ||
[new] UseUTC is not supported on msnodesqlv8 connections ([#1222](https://github.com/tediousjs/node-mssql/pull/1222)) | ||
[new] UseUTC is now supported on msnodesqlv8 connections ([#1222](https://github.com/tediousjs/node-mssql/pull/1222)) | ||
[change] Updated to latest Tedious 11 | ||
@@ -15,0 +23,0 @@ [change] Updated tarnjs to v3 |
@@ -165,3 +165,3 @@ 'use strict' | ||
Object.assign(config.options, { | ||
encrypt: true | ||
encrypt: !!value | ||
}) | ||
@@ -219,3 +219,3 @@ break | ||
Object.assign(config.options, { | ||
enableImplicitTransactions: value.toLowerCase() === 'Implicit Unbind' | ||
enableImplicitTransactions: value.toLowerCase() === 'implicit unbind' | ||
}) | ||
@@ -222,0 +222,0 @@ break |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -62,3 +62,9 @@ 'use strict' | ||
} | ||
const tedious = new tds.Connection(cfg) | ||
let tedious | ||
try { | ||
tedious = new tds.Connection(cfg) | ||
} catch (err) { | ||
rejectOnce(err) | ||
return | ||
} | ||
tedious.connect(err => { | ||
@@ -65,0 +71,0 @@ if (err) { |
@@ -0,0 +0,0 @@ MIT License |
@@ -24,3 +24,3 @@ { | ||
], | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"main": "index.js", | ||
@@ -27,0 +27,0 @@ "repository": "github:tediousjs/node-mssql", |
59
test.js
'use strict' | ||
const mssql = require('./') | ||
const wtf = require('wtfnode'); | ||
const [, , max] = process.argv | ||
const sqlConfig = { | ||
password: '&r8wrucH', | ||
database: 'StockDB', | ||
password: 'P@ssw0rd', | ||
database: 'test', | ||
stream: false, | ||
// driver: 'msnodesqlv8', | ||
options: { | ||
// trustServerCertificate: true, | ||
trustServerCertificate: true, | ||
enableArithAbort: true, | ||
encrypt: true, | ||
abortTransactionOnError: false, | ||
abortTransactionOnError: false | ||
}, | ||
pool: { | ||
max: 1, | ||
min: 0, | ||
max: max ? parseInt(max) : 10, | ||
min: 0 | ||
}, | ||
port: 1433, | ||
user: 'dhensby', | ||
server: '4sa.database.windows.net', | ||
} | ||
user: 'sa', | ||
server: 'localhost' | ||
}; | ||
// Bad URI, connection timeouts, hangs process | ||
mssql.connect({ ...sqlConfig, port: 2345 }).catch(err => { | ||
console.error(err.message); | ||
console.log('reconnecting...'); | ||
(async () => { | ||
const pool = new mssql.ConnectionPool(sqlConfig) | ||
try { | ||
await pool.connect(); | ||
// Try to connect using the right URI | ||
return mssql | ||
.connect(sqlConfig) | ||
.then(() => console.log('connected')) | ||
.then(() => mssql.close()) | ||
.then(() => console.log('closed')) | ||
.catch(err => { | ||
console.error(err.message) | ||
wtf.dump() | ||
}); // <-- Fails here | ||
}); | ||
const request = pool.request(); | ||
request.arrayRowMode = true; | ||
request.multiple = true; | ||
const result = await request.batch('SELECT 1;'); | ||
Object.entries(result.recordset.columns).forEach(([key, value]) => { | ||
console.log(`Column: ${key}, ${JSON.stringify(value)}`); | ||
}); | ||
} catch (err) { | ||
console.error(err) | ||
} finally { | ||
console.log('closing pool') | ||
await pool.close() | ||
console.log('closed') | ||
} | ||
})() |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257229
38
5195
2120