mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 06:06:01 +00:00
perspective defaults - FK columns
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { findForeignKeyForColumn } from 'dbgate-tools';
|
||||
import { DatabaseInfo, TableInfo } from 'dbgate-types';
|
||||
|
||||
export function getPerspectiveDefaultColumns(table: TableInfo, db: DatabaseInfo): string[] {
|
||||
@@ -8,6 +9,7 @@ export function getPerspectiveDefaultColumns(table: TableInfo, db: DatabaseInfo)
|
||||
x => x.toLowerCase().includes('name'),
|
||||
x => x.toLowerCase().includes('title'),
|
||||
x => x.dataType?.toLowerCase()?.includes('char'),
|
||||
x => findForeignKeyForColumn(table, x)?.columns?.length == 1,
|
||||
];
|
||||
|
||||
for (const predicate of predicates) {
|
||||
|
||||
Reference in New Issue
Block a user