fix(sidebar): support dropping schema for Dameng database
This commit is contained in:
1 parent
a6a072294a
commit
75238cde35
2 files changed
+29
-4
No files matched your search
@@ -587,7 +587,10 @@ pub fn build_create_schema_sql(options: SchemaNameSqlOptions) -> Result<String,
|
||||
|
||||
pub fn build_drop_schema_sql(options: SchemaNameSqlOptions) -> String {
|
||||
let schema = quote_table_identifier(options.database_type, &options.name);
|
||||
if matches!(options.database_type, Some(DatabaseType::Postgres | DatabaseType::Gaussdb | DatabaseType::Kwdb)) {
|
||||
if matches!(
|
||||
options.database_type,
|
||||
Some(DatabaseType::Postgres | DatabaseType::Gaussdb | DatabaseType::Kwdb | DatabaseType::Dameng)
|
||||
) {
|
||||
format!("DROP SCHEMA {schema} CASCADE;")
|
||||
} else {
|
||||
format!("DROP SCHEMA {schema};")
|
||||
@@ -1427,6 +1430,13 @@ mod tests {
|
||||
}),
|
||||
"DROP SCHEMA \"analytics\" CASCADE;"
|
||||
);
|
||||
assert_eq!(
|
||||
build_drop_schema_sql(SchemaNameSqlOptions {
|
||||
database_type: Some(DatabaseType::Dameng),
|
||||
name: "analytics".to_string(),
|
||||
}),
|
||||
"DROP SCHEMA \"analytics\" CASCADE;"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user