mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 18:56:00 +00:00
frontend - removed references to dbgate-engines
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { EngineDriver, ExtensionsDirectory } from 'dbgate-types';
|
||||
import _camelCase from 'lodash/camelCase';
|
||||
import _isString from 'lodash/isString';
|
||||
import _isPlainObject from 'lodash/isPlainObject';
|
||||
|
||||
export function extractShellApiPlugins(functionName, props): string[] {
|
||||
const res = [];
|
||||
@@ -22,3 +25,16 @@ export function extractShellApiFunctionName(functionName) {
|
||||
}
|
||||
return `dbgateApi.${functionName}`;
|
||||
}
|
||||
|
||||
export function findEngineDriver(connection, extensions: ExtensionsDirectory): EngineDriver {
|
||||
if (_isString(connection)) {
|
||||
return extensions.drivers.find((x) => x.engine == connection);
|
||||
}
|
||||
if (_isPlainObject(connection)) {
|
||||
const { engine } = connection;
|
||||
if (engine) {
|
||||
return extensions.drivers.find((x) => x.engine == engine);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user