feat: add support for Doris, StarRocks, and Redshift databases in connection handling and UI

This commit is contained in:
t8y2 committed 2026-05-01 01:26:35 +08:00
1 parent fd850d124b
commit b43e67b4fc
8 files changed
+95 -55

No files matched your search

+2 -2
View File
@@ -52,7 +52,7 @@ pub enum TransferStatus {
fn quote_identifier(name: &str, db_type: &DatabaseType) -> String {
match db_type {
DatabaseType::Mysql | DatabaseType::ClickHouse => format!("`{}`", name.replace('`', "``")),
DatabaseType::Mysql | DatabaseType::ClickHouse | DatabaseType::Doris | DatabaseType::StarRocks => format!("`{}`", name.replace('`', "``")),
DatabaseType::SqlServer => format!("[{}]", name.replace(']', "]]")),
_ => format!("\"{}\"", name.replace('"', "\"\"")),
}
@@ -71,7 +71,7 @@ fn escape_value(val: &serde_json::Value, db_type: &DatabaseType) -> String {
match val {
serde_json::Value::Null => "NULL".to_string(),
serde_json::Value::Bool(b) => match db_type {
DatabaseType::Mysql | DatabaseType::Sqlite | DatabaseType::DuckDb => {
DatabaseType::Mysql | DatabaseType::Sqlite | DatabaseType::DuckDb | DatabaseType::Doris | DatabaseType::StarRocks => {
if *b { "1".to_string() } else { "0".to_string() }
}
_ => if *b { "TRUE".to_string() } else { "FALSE".to_string() },