mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 13:06:01 +00:00
filters
This commit is contained in:
@@ -4,6 +4,7 @@ import { EngineDriver } from 'dbgate-types';
|
||||
import { DesignerInfo, DesignerTableInfo, DesignerReferenceInfo, DesignerJoinType } from './types';
|
||||
import { DesignerComponentCreator } from './DesignerComponentCreator';
|
||||
import { DesignerQueryDumper } from './DesignerQueryDumper';
|
||||
import { getFilterType } from 'dbgate-filterparser';
|
||||
|
||||
export function referenceIsConnecting(
|
||||
reference: DesignerReferenceInfo,
|
||||
@@ -129,3 +130,15 @@ export function isConnectedByReference(
|
||||
const array2 = arrays.find((a) => a.find((x) => x.designerId == table2.designerId));
|
||||
return array1 == array2;
|
||||
}
|
||||
|
||||
export function findDesignerFilterType({ designerId, columnName }, designer) {
|
||||
const table = (designer.tables || []).find((x) => x.designerId == designerId);
|
||||
if (table) {
|
||||
const column = (table.columns || []).find((x) => x.columnName == columnName);
|
||||
if (column) {
|
||||
const { dataType } = column;
|
||||
return getFilterType(dataType);
|
||||
}
|
||||
}
|
||||
return 'string';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user