Skip to content

Commit

Permalink
Merge branch '7'
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed May 18, 2022
2 parents 80f71d0 + 6d87e8a commit faabe24
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v8.1.1 (2022-05-18)
-------------------
[fix] quote identifiers in table primary keys ([#1394](https://github.com/tediousjs/node-mssql/pull/1394))

v8.1.0 (2022-04-06)
-------------------
[new] MSSQL CLI tool now accepts some options to allow overriding config file ((#1381](https://github.com/tediousjs/node-mssql/pull/1381))
Expand Down Expand Up @@ -26,6 +30,19 @@ v8.0.0 (2022-01-30)
[removed] Remove connection string parser helpers ((#1342)[https://github.com/tediousjs/node-mssql/pull/1342])
[removed] Remove deprecated pool properties ((#1359)[https://github.com/tediousjs/node-mssql/pull/1359])

v7.3.4 (2022-05-18)
-------------------
[fix] msnodesqlv8.js file was missing from previous release

v7.3.3 (2022-05-18)
-------------------
Duplicate tag

v7.3.2 (2022-05-18)
-------------------
[fix] nodemsqlv8 driver tests working against Node 10 ([#1368](https://github.com/tediousjs/node-mssql/pull/1368))
[fix] quote identifiers in table primary keys ([#1394](https://github.com/tediousjs/node-mssql/pull/1394))

v7.3.1 (2022-02-24)
-------------------
[fix] Bump debug dependency ([#1361](https://github.com/tediousjs/node-mssql/pull/1361))
Expand Down
2 changes: 1 addition & 1 deletion lib/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Table.prototype._makeBulk = function _makeBulk () {
}

Table.prototype.declare = function declare () {
const pkey = this.columns.filter(col => col.primary === true).map(col => col.name)
const pkey = this.columns.filter(col => col.primary === true).map(col => `[${col.name}]`)
const cols = this.columns.map(col => {
const def = [`[${col.name}] ${declareType(col.type, col)}`]

Expand Down
2 changes: 1 addition & 1 deletion test/common/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Unit', () => {
t.columns.add('a', sql.Int, { primary: true })
t.columns.add('b', sql.TinyInt, { nullable: true })
t.columns.add('c', sql.TinyInt, { nullable: false, primary: true })
assert.strictEqual(t.declare(), 'create table [#mytemptable] ([a] int, [b] tinyint null, [c] tinyint not null, constraint PK_mytemptable primary key (a, c))')
assert.strictEqual(t.declare(), 'create table [#mytemptable] ([a] int, [b] tinyint null, [c] tinyint not null, constraint PK_mytemptable primary key ([a], [c]))')

t = new sql.Table('MyTable')
t.columns.add('name', sql.NVarChar, {
Expand Down

0 comments on commit faabe24

Please sign in to comment.