Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(connection): use bare mysql options for oceanbase

t8y2339081af3574
diff --git a/crates/dbx-core/src/models/connection.rs b/crates/dbx-core/src/models/connection.rs
index 479e1e01c1..696ef6b346 100644
--- a/crates/dbx-core/src/models/connection.rs
+++ b/crates/dbx-core/src/models/connection.rs
@@ -171,7 +171,7 @@ impl ConnectionConfig {
.driver_profile
.as_deref()
.map(|p| p.to_lowercase())
- .is_some_and(|p| matches!(p.as_str(), "doris" | "starrocks" | "selectdb" | "tdengine"))
+ .is_some_and(|p| matches!(p.as_str(), "doris" | "starrocks" | "selectdb" | "tdengine" | "oceanbase"))
}
pub fn connection_url(&self) -> String {
@@ -634,6 +634,15 @@ mod tests {
);
}
+ #[test]
+ fn oceanbase_profile_uses_bare_mysql_connection_options() {
+ let mut config = mysql_config("user@tenant#cluster", "secret", None);
+ config.driver_profile = Some("oceanbase".to_string());
+
+ assert!(config.needs_bare_mysql());
+ assert_eq!(config.connection_url(), "mysql://user%40tenant%23cluster:[email protected]:2883?ssl-mode=disabled");
+ }
+
#[test]
fn mysql_url_encodes_password_and_database() {
let config = mysql_config("root", "p@ss:word#1", Some("db/name"));