Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;