Skip to content

Clarify support of msnodesqlv8 is v1 only - #1110

Merged
dhensby merged 1 commit into
tediousjs:6from
dhensby:pulls/msnodesql-v1
Nov 19, 2020
Merged

dhensby merged 1 commit into
tediousjs:6from
dhensby:pulls/msnodesql-v1

Conversation

@dhensby

@dhensby dhensby commented Sep 25, 2020

Copy link
Copy Markdown
Collaborator

What this does:

@dhensby
dhensby changed the base branch from master to 6 September 25, 2020 16:39
@dhensby
dhensby merged commit 3d8c4fa into tediousjs:6 Nov 19, 2020
@dhensby
dhensby deleted the pulls/msnodesql-v1 branch November 19, 2020 12:12
@TimelordUK

Copy link
Copy Markdown
Contributor

patch.zip

      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
msnodesqlv8 stress
√ streaming resume (1018ms)
- concurrent connections
- concurrent requests
- streaming off
- streaming on
√ streaming pause (1009ms)
basic test suite
√ stored procedure (exec)
√ stored procedure (batch)
√ user defined types
√ binary data
√ variant data
√ stored procedure with one empty recordset
√ empty query
√ query with no recordset
√ query with one recordset
√ query with multiple recordsets
√ query with input parameters
√ query with input parameters (batch)
√ query with output parameters
√ query with output parameters (batch)
√ query with duplicate parameters throws
√ query parameters can be replaced
√ query with error
- query with multiple errors (not supported by msnodesqlv8)
- query with raiseerror (not supported by msnodesqlv8)
√ query with pipe
√ batch
√ batch (stream)
√ create procedure batch
√ prepared statement
√ prepared statement with duplicate parameters throws
√ prepared statement parameters can be replaced
√ prepared statement with affected rows
√ prepared statement in transaction
√ transaction with rollback (224ms)
√ transaction with commit (420ms)
√ transaction throws on bad isolation level
√ transaction accepts good isolation levels
√ cancel request
√ connection healthy works
√ healthy connection goes bad
√ request timeout (1018ms)
√ dataLength type correction
- chunked json support (requires SQL Server 2016)
- chunked xml support
json support (requires SQL Server 2016)
- parser
- empty json
bulk load
√ bulk load (table) (262ms)
√ bulk load (temporary table) (259ms)
√ bulk converts dates (209ms)
msnodesqlv8 dates and times
- time
- time as parameter
√ date
√ date as parameter
√ datetime
√ datetime as parameter
√ datetime2
√ datetime2 as parameter
√ datetimeoffset
√ datetimeoffset as parameter
√ smalldatetime
√ smalldatetime as parameter
msnodesqlv8 multiple connections test suite
√ connection 1
√ connection 2
√ global connection
msnodesqlv8 connection errors
- login failed
- timeout (not supported by msnodesqlv8)
- network error (not supported by msnodesqlv8)
msnodesqlv8 connection pooling
√ max 10 (504ms)
√ max 1
- interruption (not supported by msnodesqlv8)
tvp
√ new Table
√ Recordset.toTable()

57 passing (6s)
16 pending

@dhensby

dhensby commented Dec 31, 2020

Copy link
Copy Markdown
Collaborator Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants