mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 17:55:59 +00:00
frontend - removed references to dbgate-engines
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
import { SqlDumper } from "./SqlDumper";
|
||||
|
||||
const dialect = {
|
||||
limitSelect: true,
|
||||
rangeSelect: true,
|
||||
offsetFetchRangeSyntax: true,
|
||||
stringEscapeChar: "'",
|
||||
fallbackDataType: 'nvarchar(max)',
|
||||
quoteIdentifier(s) {
|
||||
return s;
|
||||
},
|
||||
};
|
||||
|
||||
export const driverBase = {
|
||||
analyserClass: null,
|
||||
dumperClass: null,
|
||||
dumperClass: SqlDumper,
|
||||
dialect,
|
||||
|
||||
async analyseFull(pool) {
|
||||
const analyser = new this.analyserClass(pool, this);
|
||||
|
||||
@@ -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