Repository navigation
Conversation
| ### Microsoft / Contributors Node V8 Driver for Node.js for SQL Server | ||
|
|
||
| **Requires Node.js 0.12.x or newer. Windows only.** This driver is not part of the default package and must be installed separately by `npm install msnodesqlv8`. To use this driver, use this require syntax: `const sql = require('mssql/msnodesqlv8')`. | ||
| **Requires Node.js 0.12.x or newer. Windows/Linux only.** This driver is not part of the default package and must be installed separately by `npm install msnodesqlv8`. To use this driver, use this require syntax: `const sql = require('mssql/msnodesqlv8')`. |
There was a problem hiding this comment.
This line is clearly a bit old 🤦 - please can you update the node js version to v10+
| assert.strictEqual(rows, 0) | ||
| started = true | ||
| req.resume() | ||
| }, 1000) |
There was a problem hiding this comment.
waiting a second in the test suite to run this test is quite a long time. I'm not convinced we need to delay the start of the stream because this functionality is tested in other tests.
| if (rows >= 102) { | ||
| assert.strictEqual(rows, 102) | ||
| } | ||
| if (rows % 10 == 0) { |
There was a problem hiding this comment.
Do we need to test the pause/resume functionality in this test? This is covered by other tests.
|
There are some linting failures, please can you resolve those? Also, I think it's best we target the 6 branch so that this can be released in the next stable version (which I will probably do later this month or early October). Thanks a lot for the PR and digging into this issue! |
|
@mtriff as you've made the PR from your master branch, rather than breaking your master by rebasing your work onto the 6 branch, I've opened a new PR with your commits cherry-picked and I've made the changes from the review. Thanks for this |
What this does: Streams all row results when querying with msnodesqlv8.
Currently, trailing rows are not properly returned in all cases (i.e. when pausing/resuming every 10 rows, with 102 rows, the last row is never returned).
msnodesqlv8fires arowevent before emitting thecolumnevents with the column data, Currently,mssqlreturns the previous row each time it handles arowevent (so that the row will have been populated by thecolumnevents). Usually, the final row was handled in thedoneevent handler. However, in the above scenario, the lastcolumnevent gets handled after thedoneevent handler.This change switches from emitting rows on the
msnodesqlv8rowevents to emitting them after the finalcolumnevent for that row is processed. This is similar to howmsnodesqlv8implements sequilize support.