Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tedium

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tedium - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

48

lib/TdmBulkLoad.js

@@ -95,1 +95,49 @@ "use strict";

};
TdmBulkLoad.prototype.getMergeSql = function (targetTable, matchColumns, options)
{
var update = options.update || false;
var insert = options.insert || false;
var tgt = 'tgt';
var tmp = 'tmp';
if (!(matchColumns instanceof Array))
matchColumns = [ matchColumns ];
var sql = 'MERGE ' + targetTable + ' ' + tgt + ' USING ' + this.tediousBulkLoad.table + ' ' + tmp +
'\nON (' + matchColumns.map(function (c) { return tgt + '.' + c + '=' + tmp + '.' + c; }).join(' AND ') + ')';
var i;
var cols = this.tediousBulkLoad.columns;
var columnNames = [];
for (i = 0; i < cols.length; i++)
columnNames.push(cols[i].name);
if (insert)
{
sql += '\nWHEN NOT MATCHED BY TARGET THEN INSERT ' +
'\n(' + columnNames.join(',') + ')' +
'\nVALUES (' + columnNames.map(function (c) { return tmp + '.' + c; }).join(',') + ')';
}
if (update)
{
sql += '\nWHEN MATCHED THEN UPDATE SET\n';
var comma = false;
for (i = 0; i < columnNames.length; i++)
{
if (matchColumns.indexOf(columnNames[i]) !== -1)
continue;
if (comma)
sql += ',';
else
comma = true;
sql += tgt + '.' + columnNames[i] + '=' + tmp + '.' + columnNames[i];
}
}
return sql + ';';
};

2

package.json
{
"name": "tedium",
"description": "A generator-based wrapper for Tedious to make it easier to work with.",
"version": "1.0.3",
"version": "1.0.4",
"author": "Bret Copeland <bret@atlantisflight.org>",

@@ -6,0 +6,0 @@ "main": "./lib/Tedium.js",

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