getTableFormOptions moved to dialect

This commit is contained in:
Jan Prochazka
2024-09-11 14:01:11 +02:00
parent b0165c14e9
commit 7ad1950777
6 changed files with 83 additions and 79 deletions

View File

@@ -72,6 +72,26 @@ const dialect = {
quoteIdentifier(s) {
return `"${s}"`;
},
getTableFormOptions(intent) {
const isNewTable = intent == 'newTableForm';
return [
{
type: isNewTable ? 'dropdowntext' : 'text',
options: clickhouseEngines,
label: 'Engine',
name: 'tableEngine',
sqlFormatString: '^engine = %s',
disabled: !isNewTable,
},
{
type: 'text',
label: 'Comment',
name: 'objectComment',
sqlFormatString: '^comment %v',
},
];
},
};
/** @type {import('dbgate-types').EngineDriver} */
@@ -117,26 +137,6 @@ const driver = {
}
return res;
},
getTableFormOptions(intent) {
const isNewTable = intent == 'newTableForm';
return [
{
type: isNewTable ? 'dropdowntext' : 'text',
options: clickhouseEngines,
label: 'Engine',
name: 'tableEngine',
sqlFormatString: '^engine = %s',
disabled: !isNewTable,
},
{
type: 'text',
label: 'Comment',
name: 'objectComment',
sqlFormatString: '^comment %v',
},
];
},
};
module.exports = driver;