This commit is contained in:
Jan Prochazka
2020-02-03 20:44:06 +01:00
parent 8a85cfe687
commit e903122c52
4 changed files with 14 additions and 8 deletions

View File

@@ -1,15 +1,15 @@
const _ = require("lodash");
const mssql = require('./mssql');
const mysql = require('./mysql');
const postgres = require('./postgres');
const mssql = require("./mssql");
const mysql = require("./mysql");
const postgres = require("./postgres");
const drivers = {
mssql,
mysql,
postgres,
}
postgres
};
/** @return {import('@dbgate/types').EngineDriver} */
/** @type {import('@dbgate/types').EngineDriver} */
function getDriver(connection) {
if (_.isString(connection)) {
return drivers[connection];
@@ -20,6 +20,6 @@ function getDriver(connection) {
return drivers[engine];
}
}
throw new Error(`Cannot extract engine from ${connection}`)
throw new Error(`Cannot extract engine from ${connection}`);
}
module.exports = getDriver;