Skip to content

Commit

Permalink
Merge pull request #1417 from dhensby/pulls/upgrade-tds
Browse files Browse the repository at this point in the history
Update dependencies and lint fixes
  • Loading branch information
dhensby committed Aug 9, 2022
2 parents 9c9e6ca + 94fdeba commit 26f5aab
Show file tree
Hide file tree
Showing 8 changed files with 1,287 additions and 942 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: node_js
sudo: false
dist: focal
node_js:
- "10"
- "12"
- "14"
- "16"
- "18"

jobs:
include:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v9.0.0 (2022-??-??)
-------------------
[change] Upgrade tedious to v15 ([#1417](https://github.com/tediousjs/node-mssql/pull/1417))
[removed] Removed NodeJS 10 & 12 support ([#1417](https://github.com/tediousjs/node-mssql/pull/1417))

v8.1.3 (2022-08-08)
-------------------
[fix] requestTimeout correctly resolved ([#1398](https://github.com/tediousjs/node-mssql/pull/1398))
Expand Down
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ image:
- Visual Studio 2019
environment:
matrix:
- nodejs_version: "10"
- nodejs_version: "12"
- nodejs_version: "14"
- nodejs_version: "16"
- nodejs_version: "18"

install:
# https://www.appveyor.com/docs/lang/nodejs-iojs/#installing-any-version-of-nodejs-or-iojs
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:PLATFORM
- npm install
- IF %nodejs_version% GTR 10 (npm install msnodesqlv8@^2) ELSE (npm install msnodesqlv8@2.4.4)
- npm install msnodesqlv8@^2

platform:
- x86
Expand Down
15 changes: 9 additions & 6 deletions lib/tedious/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,15 @@ class Request extends BaseRequest {
debug('request(%d): query', IDS.get(this), command)

const req = new tds.Request(command, err => {
// to make sure we handle no-sql errors as well
if (err && (!errors.length || (errors.length && err.message !== errors[errors.length - 1].message))) {
err = new RequestError(err, 'EREQUEST')
if (this.stream) this.emit('error', err)
errors.push(err)
}
// tedious v15 has started using AggregateErrors to wrap multiple errors into single error objects
(err?.errors ? err.errors : [err]).forEach((e, i, { length }) => {
// to make sure we handle no-sql errors as well
if (e && (!errors.length || (errors.length && errors.length >= length && e.message !== errors[errors.length - length + i].message))) {
e = new RequestError(e, 'EREQUEST')
if (this.stream) this.emit('error', e)
errors.push(e)
}
})

// process batch outputs
if (batchHasOutput) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const INCREMENT = {

module.exports = {
objectHasProperty: (object, property) => Object.prototype.hasOwnProperty.call(object, property),
INCREMENT: INCREMENT,
INCREMENT,
IDS: {
get: IDS.get.bind(IDS),
add: (object, type, id) => {
Expand Down
Loading

0 comments on commit 26f5aab

Please sign in to comment.