clickhouse: edit table options

This commit is contained in:
Jan Prochazka
2024-09-11 12:51:09 +02:00
parent f6e0b634f0
commit ff33ec668b
6 changed files with 186 additions and 6 deletions

View File

@@ -294,12 +294,25 @@ export class SqlDumper implements AlterProcessor {
});
this.put('&<&n)');
this.tableOptions(table);
this.endCommand();
(table.indexes || []).forEach(ix => {
this.createIndex(ix);
});
}
tableOptions(table: TableInfo) {
const options = this.driver.getTableFormOptions('sqlCreateTable');
for (const option of options) {
if (table[option.name]) {
this.put('&n');
this.put(option.sqlFormatString, table[option.name]);
}
}
}
createTablePrimaryKeyCore(table: TableInfo) {
if (table.primaryKey) {
this.put(',&n');