Comparing version 11.3.0 to 11.3.1
@@ -144,16 +144,2 @@ "use strict"; | ||
/** | ||
* Escape an identifier according to SQL Server identifier naming rules. | ||
* | ||
* Does not perform validation of the identifier, only escapes the characters so it can safely be embedded into a | ||
* T-SQL statement. | ||
* | ||
* @param identifier a table name, column name, etc. | ||
* @returns the escaped identifier | ||
*/ | ||
function escapeIdentifier(identifier) { | ||
return `"${identifier.replace(/"/g, '""')}"`; | ||
} | ||
/** | ||
* A BulkLoad instance is used to perform a bulk insert. | ||
@@ -483,3 +469,3 @@ * | ||
for (const [column, direction] of Object.entries(this.bulkOptions.order)) { | ||
orderColumns.push(`${escapeIdentifier(column)} ${direction}`); | ||
orderColumns.push(`${column} ${direction}`); | ||
} | ||
@@ -504,3 +490,3 @@ | ||
getBulkInsertSql() { | ||
let sql = 'insert bulk ' + escapeIdentifier(this.table) + ' ('; | ||
let sql = 'insert bulk ' + this.table + '('; | ||
@@ -514,3 +500,3 @@ for (let i = 0, len = this.columns.length; i < len; i++) { | ||
sql += escapeIdentifier(c.name) + ' ' + c.type.declaration(c); | ||
sql += '[' + c.name + '] ' + c.type.declaration(c); | ||
} | ||
@@ -536,3 +522,3 @@ | ||
getTableCreationSql() { | ||
let sql = 'CREATE TABLE ' + escapeIdentifier(this.table) + ' (\n'; | ||
let sql = 'CREATE TABLE ' + this.table + '(\n'; | ||
@@ -546,3 +532,3 @@ for (let i = 0, len = this.columns.length; i < len; i++) { | ||
sql += escapeIdentifier(c.name) + ' ' + c.type.declaration(c); | ||
sql += '[' + c.name + '] ' + c.type.declaration(c); | ||
@@ -549,0 +535,0 @@ if (c.nullable !== undefined) { |
@@ -30,3 +30,3 @@ { | ||
"license": "MIT", | ||
"version": "11.3.0", | ||
"version": "11.3.1", | ||
"main": "./lib/tedious.js", | ||
@@ -33,0 +33,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
475996
13110