mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 13:05:58 +00:00
tsfix
This commit is contained in:
5
packages/engines/index.d.ts
vendored
Normal file
5
packages/engines/index.d.ts
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import types from "@dbgate/types";
|
||||
|
||||
export function getDriver(
|
||||
connection: string | { engine: string }
|
||||
): types.EngineDriver;
|
||||
@@ -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;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"main": "index.js",
|
||||
"typings": "./index.d.ts",
|
||||
"devDependencies": {
|
||||
"@dbgate/types": "^0.1.0",
|
||||
"@types/lodash": "^4.14.149",
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
],
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
"."
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user