Releases: TimelordUK/node-sqlserver-v8
Releases · TimelordUK/node-sqlserver-v8
v2.0.14
fix for lower node versions
v2.0.13
v2,0,12
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
bulk insertion where vector includes nulls causes unexpected behvior - 'null' txt in db column or node crashes for varbinary
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
add macos to readme
v2.0.9
- #193 - table manager bug with update SQL signature.
- #183 - transaction insert with constraint violation streaming errors fix
- #173 - alpine linux binaries included
- #189 - MacOS support / linux binaries includes - thanks for PR
- new sample code showing how to throttle, tvp and geography
- promsie safe variants of getTable and getProc
- move to class based JS
v2.0.8 - 4k string binding / node 15 binaries
-
added Node 15 binaries
v2.0.7
better sproc param management - use a param object over an array when calling
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
- #178
- add prebuilt node / electron binaries compatible with Alpine.x64 linux
v2.0.5 - non utf8 chars in query string
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