mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 00:06:01 +00:00
clickhouse + mysql: modify table option
This commit is contained in:
@@ -304,7 +304,7 @@ export class SqlDumper implements AlterProcessor {
|
||||
}
|
||||
|
||||
tableOptions(table: TableInfo) {
|
||||
const options = this.driver.getTableFormOptions('sqlCreateTable');
|
||||
const options = this.driver?.dialect?.getTableFormOptions?.('sqlCreateTable') || [];
|
||||
for (const option of options) {
|
||||
if (table[option.name]) {
|
||||
this.put('&n');
|
||||
@@ -686,6 +686,23 @@ export class SqlDumper implements AlterProcessor {
|
||||
this.putCmd('^drop %s %f', this.getSqlObjectSqlName(obj.objectTypeField), obj);
|
||||
}
|
||||
|
||||
setTableOption(table: TableInfo, optionName: string, optionValue: string) {
|
||||
const options = this?.dialect?.getTableFormOptions?.('sqlAlterTable');
|
||||
const option = options?.find(x => x.name == optionName && !x.disabled);
|
||||
if (!option) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setTableOptionCore(table, optionName, optionValue, option.sqlFormatString);
|
||||
|
||||
this.endCommand();
|
||||
}
|
||||
|
||||
setTableOptionCore(table: TableInfo, optionName: string, optionValue: string, formatString: string) {
|
||||
this.put('^alter ^table %f ', table);
|
||||
this.put(formatString, optionValue);
|
||||
}
|
||||
|
||||
fillPreloadedRows(
|
||||
table: NamedObjectInfo,
|
||||
oldRows: any[],
|
||||
|
||||
Reference in New Issue
Block a user