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(mysql): fix garbled Chinese in sidebar table comment

至高吾尚f89bf310b454
diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rs
index 428959072c..74e2fc9122 100644
--- a/crates/dbx-core/src/db/mysql.rs
+++ b/crates/dbx-core/src/db/mysql.rs
@@ -992,7 +992,9 @@ pub async fn list_tables(pool: &MySqlPool, database: &str) -> Result<Vec<TableIn
(!name.is_empty()).then_some(TableInfo {
name,
table_type: get_str_by_name(row, "TABLE_TYPE"),
- comment: get_opt_str(row, "TABLE_COMMENT").filter(|s| !s.is_empty()),
+ comment: get_opt_str(row, "TABLE_COMMENT")
+ .map(|s| fix_potential_double_encoding(&s))
+ .filter(|s| !s.is_empty()),
parent_schema: None,
parent_name: None,
})
@@ -1029,7 +1031,9 @@ async fn list_table_status_show(pool: &MySqlPool, database: &str) -> Result<Hash
(
get_str_by_name(row, "Name"),
TableStatusMeta {
- comment: get_opt_metadata_string(row, "Comment").filter(|s| !s.is_empty()),
+ comment: get_opt_metadata_string(row, "Comment")
+ .map(|s| fix_potential_double_encoding(&s))
+ .filter(|s| !s.is_empty()),
created_at: get_opt_metadata_string(row, "Create_time"),
updated_at: get_opt_metadata_string(row, "Update_time"),
},
@@ -1152,7 +1156,9 @@ fn row_to_object(row: &mysql_async::Row, database: &str) -> ObjectInfo {
name: get_str_by_name(row, "object_name"),
object_type: get_str_by_name(row, "object_type"),
schema: Some(database.to_string()),
- comment: get_opt_str(row, "object_comment").filter(|s| !s.is_empty()),
+ comment: get_opt_str(row, "object_comment")
+ .map(|s| fix_potential_double_encoding(&s))
+ .filter(|s| !s.is_empty()),
created_at: get_opt_str(row, "created_at"),
updated_at: get_opt_str(row, "updated_at"),
parent_schema: get_opt_str(row, "parent_schema"),