Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(function() {
let ConnectionFactory = require('sql-client/lib/connection-factory').ConnectionFactory;
let SQLClient = require('sql-client/lib/sql-client').SQLClient;
let SQLClientPool = require('sql-client/lib/sql-client-pool').SQLClientPool;
let mssql = require('mssql');
let bind = function (fn, me){ return function (){ return fn.apply(me, arguments); }; };
let extend = function (child, parent) { for (const key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
let hasProp = {}.hasOwnProperty;
let slice = [].slice;
let MSSQLConnectionFactory = (function(superClass) {
extend(MSSQLConnectionFactory, superClass);
function MSSQLConnectionFactory() {
this.execute = bind(this.execute, this);
this.open_connection = bind(this.open_connection, this);
return MSSQLConnectionFactory.__super__.constructor.apply(this, arguments);
(function() {
var ConnectionFactory, PostgreSQLClient, PostgreSQLClient2, PostgreSQLClientPool, PostgreSQLClientPool2, PostgreSQLConnectionFactory, PostgreSQLConnectionFactory2, SQLClient, SQLClientPool, pg,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty,
slice = [].slice;
SQLClient = require('sql-client/lib/sql-client').SQLClient;
SQLClientPool = require('sql-client/lib/sql-client-pool').SQLClientPool;
ConnectionFactory = require('sql-client/lib/connection-factory').ConnectionFactory;
pg = require('pg');
try {
if ((pg != null ? pg["native"] : void 0) != null) {
pg = pg["native"];
}
} catch(err) {
}
PostgreSQLConnectionFactory = (function(superClass) {
extend(PostgreSQLConnectionFactory, superClass);
function PostgreSQLConnectionFactory() {
this.pre_process_sql = bind(this.pre_process_sql, this);
(function() {
var ConnectionFactory, PostgreSQLClient, PostgreSQLClient2, PostgreSQLClientPool, PostgreSQLClientPool2, PostgreSQLConnectionFactory, PostgreSQLConnectionFactory2, SQLClient, SQLClientPool, pg,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty,
slice = [].slice;
SQLClient = require('sql-client/lib/sql-client').SQLClient;
SQLClientPool = require('sql-client/lib/sql-client-pool').SQLClientPool;
ConnectionFactory = require('sql-client/lib/connection-factory').ConnectionFactory;
pg = require('pg');
try {
if ((pg != null ? pg["native"] : void 0) != null) {
pg = pg["native"];
}
} catch(err) {
}
PostgreSQLConnectionFactory = (function(superClass) {
extend(PostgreSQLConnectionFactory, superClass);
(function() {
let ConnectionFactory = require('sql-client/lib/connection-factory').ConnectionFactory;
let SQLClient = require('sql-client/lib/sql-client').SQLClient;
let SQLClientPool = require('sql-client/lib/sql-client-pool').SQLClientPool;
let mssql = require('mssql');
let bind = function (fn, me){ return function (){ return fn.apply(me, arguments); }; };
let extend = function (child, parent) { for (const key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
let hasProp = {}.hasOwnProperty;
let slice = [].slice;
let MSSQLConnectionFactory = (function(superClass) {
extend(MSSQLConnectionFactory, superClass);
function MSSQLConnectionFactory() {
this.execute = bind(this.execute, this);
this.open_connection = bind(this.open_connection, this);
return MSSQLConnectionFactory.__super__.constructor.apply(this, arguments);
}
(function() {
let ConnectionFactory = require('sql-client/lib/connection-factory').ConnectionFactory;
let SQLClient = require('sql-client/lib/sql-client').SQLClient;
let SQLClientPool = require('sql-client/lib/sql-client-pool').SQLClientPool;
let mssql = require('mssql');
let bind = function (fn, me){ return function (){ return fn.apply(me, arguments); }; };
let extend = function (child, parent) { for (const key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
let hasProp = {}.hasOwnProperty;
let slice = [].slice;
let MSSQLConnectionFactory = (function(superClass) {
extend(MSSQLConnectionFactory, superClass);
function MSSQLConnectionFactory() {
this.execute = bind(this.execute, this);
this.open_connection = bind(this.open_connection, this);
return MSSQLConnectionFactory.__super__.constructor.apply(this, arguments);
}
(function() {
var ConnectionFactory, PostgreSQLClient, PostgreSQLClient2, PostgreSQLClientPool, PostgreSQLClientPool2, PostgreSQLConnectionFactory, PostgreSQLConnectionFactory2, SQLClient, SQLClientPool, pg,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty,
slice = [].slice;
SQLClient = require('sql-client/lib/sql-client').SQLClient;
SQLClientPool = require('sql-client/lib/sql-client-pool').SQLClientPool;
ConnectionFactory = require('sql-client/lib/connection-factory').ConnectionFactory;
pg = require('pg');
try {
if ((pg != null ? pg["native"] : void 0) != null) {
pg = pg["native"];
}
} catch(err) {
}
PostgreSQLConnectionFactory = (function(superClass) {
server: msg.message.config.host,
host: msg.message.config.host,
user: msg.message.config.user,
password: msg.message.config.password
};
if (msg.message.config.port) {
params.port = msg.message.config.port;
}
if (msg.message.config.dbtype === 'postgresql' && !SQL.PostgreSQLClient) {
const postgres = require(__dirname + '/lib/postgresql-client');
for (const attr in postgres) {
if (!SQL[attr]) SQL[attr] = postgres[attr];
}
} else
if (msg.message.config.dbtype === 'mssql' && !SQL.MSSQLClient) {
const mssql = require(__dirname + '/lib/mssql-client');
for (const _attr in mssql) {
if (!SQL[_attr]) SQL[_attr] = mssql[_attr];
}
}
if (msg.message.config.dbtype === 'postgresql') {
params.database = 'postgres';
} else if (msg.message.config.dbtype === 'sqlite') {
params = getSqlLiteDir(msg.message.config.fileName);
}
let timeout;
try {
const client = new SQL[clients[msg.message.config.dbtype].name](params);
timeout = setTimeout(() => {
timeout = null;
function testConnection(msg) {
msg.message.config.port = parseInt(msg.message.config.port, 10) || 0;
let params = {
server: msg.message.config.host,
host: msg.message.config.host,
user: msg.message.config.user,
password: msg.message.config.password
};
if (msg.message.config.port) {
params.port = msg.message.config.port;
}
if (msg.message.config.dbtype === 'postgresql' && !SQL.PostgreSQLClient) {
const postgres = require(__dirname + '/lib/postgresql-client');
for (const attr in postgres) {
if (!SQL[attr]) SQL[attr] = postgres[attr];
}
} else
if (msg.message.config.dbtype === 'mssql' && !SQL.MSSQLClient) {
const mssql = require(__dirname + '/lib/mssql-client');
for (const _attr in mssql) {
if (!SQL[_attr]) SQL[_attr] = mssql[_attr];
}
}
if (msg.message.config.dbtype === 'postgresql') {
params.database = 'postgres';
} else if (msg.message.config.dbtype === 'sqlite') {
params = getSqlLiteDir(msg.message.config.fileName);