Repository navigation
Clarify support of msnodesqlv8 is v1 only - #1110
Conversation
req.on('row', () => {
row = {}
if (!this.stream) recordset.push(row)
})
req.on('column', (idx, data) => {
const last = columns.length - 1
if (isChunkedRecordset) {
chunksBuffer.push(data)
} else {
data = valueCorrection(data, columns[idx])
let exi = row[columns[idx].name]
if (exi != null) {
if (exi instanceof Array) {
exi.push(data)
} else {
row[columns[idx].name] = [exi, data]
}
} else {
row[columns[idx].name] = data
}
}
if (idx == last) {
if (row) {
if (isChunkedRecordset) return
if (row.___return___ == null) {
// row with ___return___ col is the last row
if (this.stream) this.emit('row', row)
}
}
}
})hi, looking at the streaming code your side, i think you would be better off with something similar to that attached - basically you are a row behind so I emit twice for your first received in test hence when the test pauses, we will publish another row. There then seems to code in meta and done. I dropped all that and only emit when column count reaches a full row, This is easier to understand and the tests pass as now we have a 1 for 1 of when we emit to when you emit and hence the pause resume seems to work. I attach the zip - testing my side against v2 of mssqlnodev8 i now see from your suite msnodesqlv8 57 passing (6s) |
|
@TimelordUK - thanks for this - I've had a look at the patch, but it looks like it's been written against quite an old version of the mssql library so I'm not clear where the actual changes have been made... Are you able to upload either a diff or open a PR? I've tried to apply the changes and added it to #1157 |
What this does: