Comparing version 5.1.4 to 5.1.5
@@ -0,1 +1,9 @@ | ||
v5.1.5 (2021-05-13) | ||
------------------- | ||
[fix] Bump various dependencies for security fixes | ||
v5.1.4 (2021-01-01) | ||
------------------- | ||
[fix] Ensure line endings are unix style (LF) | ||
v5.1.3 (2020-09-18) | ||
@@ -2,0 +10,0 @@ ------------------- |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -0,0 +0,0 @@ 'use strict' |
@@ -0,0 +0,0 @@ MIT License |
@@ -24,3 +24,3 @@ { | ||
], | ||
"version": "5.1.4", | ||
"version": "5.1.5", | ||
"main": "index.js", | ||
@@ -30,4 +30,4 @@ "repository": "github:tediousjs/node-mssql", | ||
"dependencies": { | ||
"debug": "^3.2.6", | ||
"generic-pool": "^3.7.1", | ||
"debug": "^3.2.7", | ||
"generic-pool": "^3.7.2", | ||
"tedious": "^4.2.0" | ||
@@ -34,0 +34,0 @@ }, |
52
test.js
'use strict' | ||
const mssql = require('./') | ||
const { v4: uuid } = require('uuid') | ||
const wtf = require('wtfnode'); | ||
const [, , max] = process.argv; | ||
const sqlConfig = { | ||
password: 'Upper_l0wercase', | ||
database: 'di_production', | ||
password: '&r8wrucH', | ||
database: 'StockDB', | ||
stream: false, | ||
// driver: 'msnodesqlv8', | ||
options: { | ||
// trustedConnection: true, | ||
trustServerCertificate: true, | ||
// trustServerCertificate: true, | ||
enableArithAbort: true, | ||
encrypt: true, | ||
// abortTransactionOnError: false, | ||
abortTransactionOnError: false, | ||
}, | ||
pool: { | ||
max: max ? parseInt(max) : 10, | ||
max: 1, | ||
min: 0, | ||
}, | ||
port: 1433, | ||
user: 'sa', | ||
server: 'localhost', | ||
}; | ||
user: 'dhensby', | ||
server: '4sa.database.windows.net', | ||
} | ||
(async () => { | ||
const pools = await Promise.all(Array.from(new Array(100)).map(() => { | ||
return new mssql.ConnectionPool(sqlConfig).connect() | ||
})) | ||
setInterval(async () => { | ||
const pool = pools[Math.floor(Math.random() * pools.length)] | ||
const ps = new mssql.PreparedStatement(pool) | ||
ps.input('tempParam', mssql.TYPES.NVarChar) | ||
await ps.prepare('SELECT TOP 10 * FROM [debug] WHERE [tempData] = @tempParam') | ||
await ps.execute({ tempParam: '{}' }) | ||
await ps.unprepare() | ||
}, 100) | ||
})() | ||
// Bad URI, connection timeouts, hangs process | ||
mssql.connect({ ...sqlConfig, port: 2345 }).catch(err => { | ||
console.error(err.message); | ||
console.log('reconnecting...'); | ||
// 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 | ||
}); |
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
203210
19
4197
Updateddebug@^3.2.7
Updatedgeneric-pool@^3.7.2