fix(table-data): load metadata before initial query

This commit is contained in:
t8y2 committed 2026-06-11 23:19:45 +08:00
1 parent 3640541222
commit 3f7987aa59
2 files changed
+39 -37

No files matched your search

+2 -2
View File
@@ -1325,7 +1325,7 @@ fn fix_potential_double_encoding(s: &str) -> String {
pub async fn get_columns(pool: &MySqlPool, database: &str, table: &str) -> Result<Vec<ColumnInfo>, String> {
let sql = columns_sql(database, table);
let mut conn = pool.get_conn().await.map_err(|e| e.to_string())?;
let mut conn = get_conn_with_health_check(pool).await?;
let result = match conn.query_iter(&sql).await {
Ok(result) => result,
Err(err) => {
@@ -1375,7 +1375,7 @@ pub async fn get_columns(pool: &MySqlPool, database: &str, table: &str) -> Resul
pub async fn get_columns_show(pool: &MySqlPool, database: &str, table: &str) -> Result<Vec<ColumnInfo>, String> {
let sql = show_columns_sql(database, table, true);
let mut conn = pool.get_conn().await.map_err(|e| e.to_string())?;
let mut conn = get_conn_with_health_check(pool).await?;
let rows: Vec<mysql_async::Row> = match conn.query_iter(&sql).await {
Ok(result) => result.collect_and_drop().await.map_err(|e| e.to_string())?,
Err(_) => {