-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathConnectorIdentifier.js
41 lines (39 loc) · 1.53 KB
/
ConnectorIdentifier.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var debug = require('debug')('connector:indentifier');
exports.identify = function() {
return identifyConnection(arguments[0]);
}
function identifyConnection(json) {
var objConnection = null;
if (json.type == 'database') {
if (json.databaseType == "mysql") {
objConnection = require('./MySQLConnector.js');
} else if (json.databaseType == "mssql") {
objConnection = require('./MSSQLConnector.js');
} else if (json.databaseType == "postgres") {
objConnection = require('./PostgresConnector.js');
}
/*else if (json.databaseType == "mssql") {
objConnection = require('./MSSQLConnector.js');
}
else if (json.databaseType == "elasticsearch") {
objConnection = require('./ElasticSearchConnector.js');
}*/
else if (json.databaseType == "cassandra") {
objConnection = require('./CassandraConnector.js');
} else if (json.databaseType == "clickhouse") {
objConnection = require('./ClickhouseConnector.js');
} else if (json.databaseType == "redshift") {
objConnection = require('./RedShiftConnector.js');
}else if (json.databaseType == "json") {
objConnection = require('./JSONConnector.js');
} else if (json.databaseType === "influx") {
objConnection = require('./InfluxConnector.js')
} else if (json.databaseType === "bigquery"){
objConnection = require('./BigQueryConnector.js')
} else if (json.databaseType === "snowflake"){
objConnection = require('./SnowflakeConnector.js')
}
} else {
}
return objConnection;
}