fix(dameng): emit modify syntax for column changes

Closes #8517
This commit is contained in:
t8y2 committed 2026-09-09 10:28:03 +08:00
1 parent 9690feee4f
commit 7835f4c309
2 files changed
+25 -2

No files matched your search

+15 -1
View File
@@ -209,6 +209,14 @@ impl DdlDialectProfile {
}
}
pub fn alter_modify_keyword(&self) -> &'static str {
if self.database_type == DatabaseType::Dameng {
"MODIFY"
} else {
"MODIFY COLUMN"
}
}
/// Replace `{key}` placeholders. Unknown keys are left unchanged.
pub fn render_template(template: &str, vars: &[(&str, &str)]) -> String {
let mut out = template.to_string();
@@ -759,6 +767,12 @@ pub fn profile_for(db_type: DatabaseType) -> DdlDialectProfile {
// MySQL family
Mysql | Doris | StarRocks | Goldendb | Sundb | Databend | Gbase | ManticoreSearch => mysql_family(db_type),
Dameng => {
let mut profile = oracle_family(db_type);
profile.alter_uses_modify_column = true;
profile
}
// PostgreSQL family
Postgres | Redshift | Gaussdb | Kingbase | Highgo | Vastbase | OpenGauss | Kwdb | Uxdb => {
postgres_family(db_type)
@@ -775,7 +789,7 @@ pub fn profile_for(db_type: DatabaseType) -> DdlDialectProfile {
}
// Oracle family
Oracle | Dameng | OceanbaseOracle | Yashandb | Xugu | Iris => oracle_family(db_type),
Oracle | OceanbaseOracle | Yashandb | Xugu | Iris => oracle_family(db_type),
// SQL Server (not Access)
SqlServer => sqlserver_family(db_type),