Skip to content

Releases: TimelordUK/node-sqlserver-v8

v2.0.14

15 Apr 21:02

Choose a tag to compare

fix for lower node versions

v2.0.13

07 Apr 19:28

Choose a tag to compare

enhanced error reporting i.e. sproc number, servername etc

  1. #202

v2,0,12

27 Mar 15:00

Choose a tag to compare

  1. #200
  test('use tableMgr bulk insert varchar vector - exactly 4000 chars', testDone => {
    async function runner () {
      const b = repeat('z', 4000)
      const helper = new TypeTableHelper(theConnection, 'NVARCHAR(MAX)')
      const expected = helper.getVec(10, i => b)
      const table = await helper.create()
      const promisedInsert = util.promisify(table.insertRows)
      const promisedSelect = util.promisify(table.selectRows)
      try {
        await promisedInsert(expected)
        const res = await promisedSelect(expected)
        assert.deepStrictEqual(res, expected)
      } catch (e) {
        assert.ifError(e)
      }
    }
    runner().then(() => {
      testDone()
    })
  })

v2.0.11

26 Jan 23:38

Choose a tag to compare

bulk insertion where vector includes nulls causes unexpected behvior - 'null' txt in db column or node crashes for varbinary

#194

test('use tableMgr bulk insert varbinary vector - with null', testDone => {
    async function runner () {
      const b = Buffer.from('0102030405060708090a', 'hex')
      const helper = new TypeTableHelper(theConnection, 'varbinary(10)')
      const expected = helper.getVec(10, i => i % 2 === 0 ? null : b)
      const table = await helper.create()
      const promisedInsert = util.promisify(table.insertRows)
      const promisedSelect = util.promisify(table.selectRows)
      try {
        await promisedInsert(expected)
        const res = await promisedSelect(expected)
        assert.deepStrictEqual(res, expected)
      } catch (e) {
        assert.ifError(e)
      }
    }
    runner().then(() => {
      testDone()
    })
  })

v2.0.10

10 Jan 17:57

Choose a tag to compare

add macos to readme

v2.0.9

28 Dec 15:26

Choose a tag to compare

  1. #193 - table manager bug with update SQL signature.
  2. #183 - transaction insert with constraint violation streaming errors fix
  3. #173 - alpine linux binaries included
  4. #189 - MacOS support / linux binaries includes - thanks for PR
  5. new sample code showing how to throttle, tvp and geography
  6. promsie safe variants of getTable and getProc
  7. move to class based JS

v2.0.8 - 4k string binding / node 15 binaries

21 Nov 16:40

Choose a tag to compare

v2.0.7

03 Nov 00:06

Choose a tag to compare

better sproc param management - use a param object over an array when calling

  1. #181
  2. #182

now you can use an input object

const spName = 'test_sp_get_optional_p'
const a = 10
const b = 20
const def = `alter PROCEDURE <name> (
  @plus INT out,
  @a INT = ${a},
  @b INT = ${b}
  )
AS begin
  -- SET XACT_ABORT ON;
  SET NOCOUNT ON;
  set @plus = @a + @b;
end;

`
call with no params, the driver now assumes they are default input and will not bind them i.e.

      const o = {}
      proc.call(o, (err, results, output) => {

you can bind one param

      const o = {
         a: 10
     }
      proc.call(o, (err, results, output) => {

or both

      const o = {
         a: 10,
         b: 20
     }
      proc.call(o, (err, results, output) => {

i have tried quite a few combinations including all output and 1 optional

const a = 20
const def = `alter PROCEDURE <name> (
  @t1 INT out,
  @t2 INT out,
  @t3 INT out,
  @a INT = ${a}
  )
AS begin
  -- SET XACT_ABORT ON;
  SET NOCOUNT ON;
  set @t1 = @a;
  set @t2 = @a * 2;
  set @t3 = @a * 3;
end;

const o = {}
proc.call(o, (err, results, output) => {
assert.ifError(err)
if (output) {
assert(Array.isArray(output))
const expected = [
0,
a,
a * 2,
a * 3
]
assert.deepStrictEqual(expected, output)
I will release shortly

linuxmusl binaries Alpine x64 / binary blob leaks

17 Oct 20:07

Choose a tag to compare

  1. #178
  2. add prebuilt node / electron binaries compatible with Alpine.x64 linux

v2.0.5 - non utf8 chars in query string

29 Aug 15:01

Choose a tag to compare

  1. #170
  test('query containing Swedish "åäö" as sql query literal no params', testDone => {
    const STR_LEN = 10
    const str = 'åäö'.repeat(STR_LEN)
    theConnection.query(`select '${str}' as data`, (err, res) => {
      assert.ifError(err)
      const expected = [{
        data: str
      }]
      assert.deepStrictEqual(expected, res)
      testDone()
    })
  })

2. 1 less memory copy per query submitted