feat(dameng): full DM8 database support
Adds Dameng DM8 explain/autotrace support and user-management SQL support, with backend autotrace safety checks and escaped CREATE USER SQL.
This commit is contained in:
1 parent
a5659d7637
commit
897e6998fd
22 files changed
+1154
-55
No files matched your search
@@ -144,6 +144,15 @@ pub fn build_duckdb_attach_database_sql(options: DuckDbAttachDatabaseSqlOptions)
|
||||
)
|
||||
}
|
||||
|
||||
pub fn build_create_user_sql(username: &str, password: &str, tablespace: &str) -> String {
|
||||
format!(
|
||||
"CREATE USER {} IDENTIFIED BY {} DEFAULT TABLESPACE {};",
|
||||
quote_table_identifier(Some(DatabaseType::Dameng), username),
|
||||
quote_sql_string(password),
|
||||
quote_table_identifier(Some(DatabaseType::Dameng), tablespace)
|
||||
)
|
||||
}
|
||||
|
||||
pub fn build_drop_object_sql(options: DropObjectSqlOptions) -> String {
|
||||
format!(
|
||||
"DROP {} {};",
|
||||
@@ -492,6 +501,14 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn builds_dameng_create_user_sql_with_escaped_values() {
|
||||
assert_eq!(
|
||||
build_create_user_sql("app\"user", "pa'ss", "main\"space"),
|
||||
"CREATE USER \"app\"\"user\" IDENTIFIED BY 'pa''ss' DEFAULT TABLESPACE \"main\"\"space\";"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn builds_drop_and_clear_table_sql() {
|
||||
let options = TableAdminSqlOptions {
|
||||
|
||||
Reference in new issue
Block a user