forked from darshit-shah/node-database-connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectorIdentifier.js
29 lines (27 loc) · 934 Bytes
/
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
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 == "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 {
}
return objConnection;
}