Socket
Socket
Sign inDemoInstall

tedious

Package Overview
Dependencies
Maintainers
8
Versions
227
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tedious - npm Package Compare versions

Comparing version 11.1.0 to 11.1.1

22

lib/bulk-load.js

@@ -151,2 +151,16 @@ "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.

@@ -493,3 +507,3 @@ *

getBulkInsertSql() {
let sql = 'insert bulk ' + this.table + '(';
let sql = 'insert bulk ' + escapeIdentifier(this.table) + ' (';

@@ -503,3 +517,3 @@ for (let i = 0, len = this.columns.length; i < len; i++) {

sql += '[' + c.name + '] ' + c.type.declaration(c);
sql += escapeIdentifier(c.name) + ' ' + c.type.declaration(c);
}

@@ -525,3 +539,3 @@

getTableCreationSql() {
let sql = 'CREATE TABLE ' + this.table + '(\n';
let sql = 'CREATE TABLE ' + escapeIdentifier(this.table) + ' (\n';

@@ -535,3 +549,3 @@ for (let i = 0, len = this.columns.length; i < len; i++) {

sql += '[' + c.name + '] ' + c.type.declaration(c);
sql += escapeIdentifier(c.name) + ' ' + c.type.declaration(c);

@@ -538,0 +552,0 @@ if (c.nullable !== undefined) {

2

package.json

@@ -30,3 +30,3 @@ {

"license": "MIT",
"version": "11.1.0",
"version": "11.1.1",
"main": "./lib/tedious.js",

@@ -33,0 +33,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc