forked from darshit-shah/node-database-executor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConnectorIdentifier.js
More file actions
37 lines (33 loc) · 1.27 KB
/
Copy pathConnectorIdentifier.js
File metadata and controls
37 lines (33 loc) · 1.27 KB
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
var debug = require('debug')('executor:indentifier');
exports.identify = function() {
return identifyConnection(arguments[0]);
}
function identifyConnection(json) {
debug("CLICKHOUSE IDENTIFIED------------------------",json)
var objConnection = null;
if (json.type == 'database') {
if (json.databaseType == "mysql") {
objConnection = require('./MySQLExecutor.js');
} else if (json.databaseType == "mssql") {
objConnection = require('./MSSQLExecutor.js');
} else if (json.databaseType == "cassandra") {
objConnection = require('./CassandraExecutor.js');
} else if (json.databaseType == "clickhouse") {
objConnection = require('./ClickhouseExecutor.js');
} else if (json.databaseType == "redshift") {
objConnection = require('./RedShiftExecutor.js');
} else if (json.databaseType == "json") {
objConnection = require('./JSONExecutor.js');
} else if (json.databaseType === "influx") {
objConnection = require('./InfluxExecutor.js');
}
/*else if (json.databaseType == "mssql") {
objConnection = require('./MSSQLConnector.js');
}
else if (json.databaseType == "elasticsearch") {
objConnection = require('./ElasticSearchConnector.js');
}*/
} else {
}
return objConnection;
}