clickhouse + mysql: modify table option

This commit is contained in:
Jan Prochazka
2024-09-11 15:09:16 +02:00
parent 7ad1950777
commit fb39cd1302
12 changed files with 88 additions and 21 deletions

View File

@@ -1,6 +1,10 @@
const { SqlDumper } = require('dbgate-tools');
class Dumper extends SqlDumper {
setTableOptionCore(table, optionName, optionValue, formatString) {
this.put('^alter ^table %f ^modify ', table);
this.put(formatString, optionValue);
}
}
module.exports = Dumper;

View File

@@ -74,7 +74,7 @@ const dialect = {
},
getTableFormOptions(intent) {
const isNewTable = intent == 'newTableForm';
const isNewTable = intent == 'newTableForm' || intent == 'sqlCreateTable';
return [
{
type: isNewTable ? 'dropdowntext' : 'text',

View File

@@ -105,21 +105,19 @@ const dialect = {
},
getTableFormOptions(intent) {
const isNewTable = intent == 'newTableForm';
return [
{
type: isNewTable ? 'dropdowntext' : 'text',
type: 'dropdowntext',
options: this.getSupportedEngines(),
label: 'Engine',
name: 'tableEngine',
sqlFormatString: '^engine = %s',
disabled: !isNewTable,
},
{
type: 'text',
label: 'Comment',
name: 'objectComment',
sqlFormatString: '^comment %v',
sqlFormatString: '^comment = %v',
},
];
},