fix(dbx-core): migrate mysql driver to mysql_async

Add mysql_async with client_ed25519 support for MySQL and MariaDB connections.\nSwitch MySQL transaction control and schema metadata reads away from sqlx MySQL APIs.\nPreserve connection compatibility by stripping unsupported URL params and handling nullable metadata safely.
This commit is contained in:
t8y2 committed 2026-05-24 00:53:27 +08:00
1 parent 777cb11081
commit 3e051d61a7
8 files changed
+625 -355

No files matched your search

+6 -4
View File
@@ -217,21 +217,21 @@ pub async fn test_connection(state: State<'_, Arc<AppState>>, config: Connection
Ok(()) => match config.db_type {
DatabaseType::Mysql if config.needs_bare_mysql() => match db::mysql::connect_bare(&url).await {
Ok(pool) => {
pool.close().await;
let _ = pool.disconnect().await;
Ok("Connection successful".to_string())
}
Err(e) => Err(e),
},
DatabaseType::Mysql => match db::mysql::connect(&url).await {
Ok(pool) => {
pool.close().await;
let _ = pool.disconnect().await;
Ok("Connection successful".to_string())
}
Err(e) => Err(e),
},
DatabaseType::Doris | DatabaseType::StarRocks => match db::mysql::connect_bare(&url).await {
Ok(pool) => {
pool.close().await;
let _ = pool.disconnect().await;
Ok("Connection successful".to_string())
}
Err(e) => Err(e),
@@ -435,7 +435,9 @@ pub async fn disconnect_db(state: State<'_, Arc<AppState>>, connection_id: Strin
for key in keys_to_remove {
if let Some(pool) = conns.remove(&key) {
match pool {
PoolKind::Mysql(p, _) => p.close().await,
PoolKind::Mysql(p, _) => {
let _ = p.disconnect().await;
}
PoolKind::Postgres(p) => p.close().await,
PoolKind::Sqlite(p) => p.close().await,
PoolKind::Redis(_) => {}