dbgate-tools
Version:
Auxiliary tools for other DbGate packages.
129 lines (128 loc) • 6.39 kB
TypeScript
import type { ColumnInfo, ConstraintInfo, EngineDriver, ForeignKeyInfo, FunctionInfo, NamedObjectInfo, PrimaryKeyInfo, ProcedureInfo, SqlDialect, TableInfo, TransformType, TriggerInfo, ViewInfo, IndexInfo, UniqueInfo, CheckInfo, AlterProcessor, SqlObjectInfo, CallableObjectInfo, SchedulerEventInfo } from 'dbgate-types';
export declare class SqlDumper implements AlterProcessor {
s: string;
driver: EngineDriver;
dialect: SqlDialect;
indentLevel: number;
static keywordsCase: string;
static convertKeywordCase(keyword: any): string;
constructor(driver: EngineDriver);
endCommand(): void;
putRaw(text: any): void;
escapeString(value: any): string;
putStringValue(value: any): void;
putByteArrayValue(value: any): void;
putValue(value: any, dataType?: any): void;
putCmd(format: any, ...args: any[]): void;
putFormattedValue(c: any, value: any): void;
putFormattedList(c: any, collection: any): void;
put(format: string, ...args: any[]): void;
autoIncrement(): void;
createDatabase(name: string): void;
dropDatabase(name: string): void;
createSchema(name: string): void;
dropSchema(name: string): void;
specialColumnOptions(column: any): void;
selectScopeIdentity(table: TableInfo): void;
columnType(dataType: string): void;
columnDefinition(column: ColumnInfo, { includeDefault, includeNullable, includeCollate }?: {
includeDefault?: boolean;
includeNullable?: boolean;
includeCollate?: boolean;
}): void;
columnDefault(column: ColumnInfo): void;
putCollection<T>(delimiter: string, collection: T[], lambda: (col: T) => void): void;
createTable(table: TableInfo): void;
tableOptions(table: TableInfo): void;
createTablePrimaryKeyCore(table: TableInfo): void;
createForeignKeyFore(fk: ForeignKeyInfo): void;
transform(type: TransformType, dumpExpr: any): void;
allowIdentityInsert(table: NamedObjectInfo, allow: boolean): void;
enableConstraints(table: NamedObjectInfo, enabled: boolean): void;
enableAllForeignKeys(enabled: boolean): void;
comment(value: string): void;
createView(obj: ViewInfo): void;
dropView(obj: ViewInfo, { testIfExists }: {
testIfExists?: boolean;
}): void;
alterView(obj: ViewInfo): void;
changeViewSchema(obj: ViewInfo, newSchema: string): void;
renameView(obj: ViewInfo, newSchema: string): void;
createMatview(obj: ViewInfo): void;
dropMatview(obj: ViewInfo, { testIfExists }: {
testIfExists?: boolean;
}): void;
alterMatview(obj: ViewInfo): void;
changeMatviewSchema(obj: ViewInfo, newSchema: string): void;
renameMatview(obj: ViewInfo, newSchema: string): void;
createProcedure(obj: ProcedureInfo): void;
dropProcedure(obj: ProcedureInfo, { testIfExists }: {
testIfExists?: boolean;
}): void;
alterProcedure(obj: ProcedureInfo): void;
changeProcedureSchema(obj: ProcedureInfo, newSchema: string): void;
renameProcedure(obj: ProcedureInfo, newSchema: string): void;
createFunction(obj: FunctionInfo): void;
dropFunction(obj: FunctionInfo, { testIfExists }: {
testIfExists?: boolean;
}): void;
alterFunction(obj: FunctionInfo): void;
changeFunctionSchema(obj: FunctionInfo, newSchema: string): void;
renameFunction(obj: FunctionInfo, newSchema: string): void;
createTrigger(obj: TriggerInfo): void;
dropTrigger(obj: TriggerInfo, { testIfExists }: {
testIfExists?: boolean;
}): void;
alterTrigger(obj: TriggerInfo): void;
changeTriggerSchema(obj: TriggerInfo, newSchema: string): void;
renameTrigger(obj: TriggerInfo, newSchema: string): void;
createSchedulerEvent(obj: SchedulerEventInfo): void;
dropSchedulerEvent(obj: SchedulerEventInfo, { testIfExists }: {
testIfExists?: boolean;
}): void;
dropConstraintCore(cnt: ConstraintInfo): void;
dropConstraint(cnt: ConstraintInfo): void;
createConstraint(cnt: ConstraintInfo): void;
changeConstraint(oldConstraint: ConstraintInfo, newConstraint: ConstraintInfo): void;
dropForeignKey(fk: ForeignKeyInfo): void;
createForeignKey(fk: ForeignKeyInfo): void;
dropPrimaryKey(pk: PrimaryKeyInfo): void;
createPrimaryKey(pk: PrimaryKeyInfo): void;
dropIndex(ix: IndexInfo): void;
createIndex(ix: IndexInfo): void;
dropUnique(uq: UniqueInfo): void;
createUniqueCore(uq: UniqueInfo): void;
createUnique(uq: UniqueInfo): void;
dropCheck(ch: CheckInfo): void;
createCheckCore(ch: CheckInfo): void;
createCheck(ch: CheckInfo): void;
renameConstraint(constraint: ConstraintInfo, newName: string): void;
createColumn(column: ColumnInfo, constraints: ConstraintInfo[]): void;
inlineConstraints(constrains: ConstraintInfo[]): void;
dropColumn(column: ColumnInfo): void;
renameColumn(column: ColumnInfo, newName: string): void;
changeColumn(oldcol: ColumnInfo, newcol: ColumnInfo, constraints: ConstraintInfo[]): void;
dropTable(obj: TableInfo, { testIfExists }?: {
testIfExists?: boolean;
}): void;
changeTableSchema(obj: TableInfo, schema: string): void;
renameTable(obj: TableInfo, newname: string): void;
renameSqlObject(obj: SqlObjectInfo, newname: string): void;
beginTransaction(): void;
commitTransaction(): void;
rollbackTransaction(): void;
alterProlog(): void;
alterEpilog(): void;
selectTableIntoNewTable(sourceName: NamedObjectInfo, targetName: NamedObjectInfo): void;
truncateTable(name: NamedObjectInfo): void;
dropConstraints(table: TableInfo, dropReferences?: boolean): void;
recreateTable(oldTable: TableInfo, newTable: TableInfo): void;
createSqlObject(obj: SqlObjectInfo): void;
getSqlObjectSqlName(ojectTypeField: string): "PROCEDURE" | "VIEW" | "FUNCTION" | "TRIGGER" | "MATERIALIZED VIEW" | "EVENT";
dropSqlObject(obj: SqlObjectInfo): void;
setTableOption(table: TableInfo, optionName: string, optionValue: string): void;
setTableOptionCore(table: TableInfo, optionName: string, optionValue: string, formatString: string): void;
fillNewNotNullDefaults(col: ColumnInfo): void;
fillPreloadedRows(table: NamedObjectInfo, oldRows: any[], newRows: any[], key: string[], insertOnly: string[], autoIncrementColumn: string): void;
callableTemplate(func: CallableObjectInfo): void;
}