change structure generates data commands

This commit is contained in:
Jan Prochazka
2023-02-16 13:14:56 +01:00
parent cd1267b464
commit edf0637a35
8 changed files with 127 additions and 24 deletions

View File

@@ -10,6 +10,7 @@ import {
Expression,
} from 'dbgate-sqltree';
import type { NamedObjectInfo, DatabaseInfo, TableInfo } from 'dbgate-types';
import { JsonDataObjectUpdateCommand } from 'dbgate-tools';
export interface ChangeSetItem {
pureName: string;
@@ -21,15 +22,9 @@ export interface ChangeSetItem {
fields?: { [column: string]: string };
}
export interface ChangeSetDataUpdateCommand {
type: 'renameField' | 'deleteField' | 'setField';
field: string;
value?: any;
}
export interface ChangeSet {
structure?: TableInfo;
dataUpdateCommands?: ChangeSetDataUpdateCommand[];
dataUpdateCommands?: JsonDataObjectUpdateCommand[];
setColumnMode?: 'fixed' | 'variable';
inserts: ChangeSetItem[];
updates: ChangeSetItem[];