From 75d7edda27d864ebf5fc9d5b863e1bdea32812ab Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 7 May 2026 14:35:09 +0800 Subject: [PATCH] fix: add missing comment field to TableInfo initializers The comment field was added to TableInfo but not updated in clickhouse, gaussdb, oracle, sqlite, sqlserver, dm, and schema drivers. --- crates/dbx-core/src/db/clickhouse_driver.rs | 6 +++++- crates/dbx-core/src/db/dm_driver.rs | 1 + crates/dbx-core/src/db/gaussdb_driver.rs | 1 + crates/dbx-core/src/db/oracle_driver.rs | 1 + crates/dbx-core/src/db/sqlite.rs | 1 + crates/dbx-core/src/db/sqlserver.rs | 1 + crates/dbx-core/src/schema.rs | 4 +++- 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/crates/dbx-core/src/db/clickhouse_driver.rs b/crates/dbx-core/src/db/clickhouse_driver.rs index 6679d67194..0045ff1d72 100644 --- a/crates/dbx-core/src/db/clickhouse_driver.rs +++ b/crates/dbx-core/src/db/clickhouse_driver.rs @@ -96,7 +96,11 @@ pub async fn list_tables(client: &ChClient, database: &str) -> Result Result, St .map(|r| TableInfo { name: r.first().cloned().unwrap_or_default(), table_type: r.get(1).cloned().unwrap_or_else(|| "TABLE".to_string()), + comment: None, }) .collect()) } diff --git a/crates/dbx-core/src/db/gaussdb_driver.rs b/crates/dbx-core/src/db/gaussdb_driver.rs index bf833b51b8..bd99c150e8 100644 --- a/crates/dbx-core/src/db/gaussdb_driver.rs +++ b/crates/dbx-core/src/db/gaussdb_driver.rs @@ -78,6 +78,7 @@ pub async fn list_tables(client: &mut GaussdbClient, schema: &str) -> Result Result Result("name"), table_type: if t == "view" { "VIEW".to_string() } else { "BASE TABLE".to_string() }, + comment: None, } }) .collect()) diff --git a/crates/dbx-core/src/db/sqlserver.rs b/crates/dbx-core/src/db/sqlserver.rs index fa05f6f2e9..db7443fe0a 100644 --- a/crates/dbx-core/src/db/sqlserver.rs +++ b/crates/dbx-core/src/db/sqlserver.rs @@ -106,6 +106,7 @@ pub async fn list_tables(client: &mut SqlServerClient, schema: &str) -> Result(0).unwrap_or("").to_string(), table_type: row.get::<&str, _>(1).unwrap_or("BASE TABLE").to_string(), + comment: None, }) .collect()) } diff --git a/crates/dbx-core/src/schema.rs b/crates/dbx-core/src/schema.rs index 591481ef2e..5d5ec40deb 100644 --- a/crates/dbx-core/src/schema.rs +++ b/crates/dbx-core/src/schema.rs @@ -9,7 +9,9 @@ pub fn duckdb_query_tables(con: &duckdb::Connection) -> Result(0)?, table_type: row.get::<_, String>(1)? })) + .query_map([], |row| { + Ok(db::TableInfo { name: row.get::<_, String>(0)?, table_type: row.get::<_, String>(1)?, comment: None }) + }) .map_err(|e| e.to_string())?; Ok(rows.filter_map(|r| r.ok()).collect()) }