generate update script

This commit is contained in:
Jan Prochazka
2020-03-23 20:41:40 +01:00
parent 1560b7c2e0
commit 464662cb18
17 changed files with 281 additions and 71 deletions

View File

@@ -1,6 +1,6 @@
import _ from 'lodash';
import { GridConfig, GridCache, GridConfigColumns } from './GridConfig';
import { ForeignKeyInfo, TableInfo, ColumnInfo, DbType } from '@dbgate/types';
import { ForeignKeyInfo, TableInfo, ColumnInfo, DbType, EngineDriver } from '@dbgate/types';
import { parseFilter, getFilterType } from '@dbgate/filterparser';
import { filterName } from './filterName';
import { Select, Expression } from '@dbgate/sqltree';
@@ -44,12 +44,14 @@ export abstract class GridDisplay {
protected setConfig: (config: GridConfig) => void,
public cache: GridCache,
protected setCache: (config: GridCache) => void,
protected getTableInfo: ({ schemaName, pureName }) => Promise<TableInfo>
protected getTableInfo: ({ schemaName, pureName }) => Promise<TableInfo>,
public driver: EngineDriver
) {}
abstract getPageQuery(offset: number, count: number): string;
columns: DisplayColumn[];
baseTable?: TableInfo;
changeSetKeyFields: string[] = null;
setColumnVisibility(uniquePath: string[], isVisible: boolean) {
const uniqueName = uniquePath.join('.');
if (uniquePath.length == 1) {
@@ -60,6 +62,10 @@ export abstract class GridDisplay {
}
}
get engine() {
return this.driver.engine;
}
reload() {
this.setCache({
...this.cache,