fix(kingbase): load comments in MySQL compatibility mode
This commit is contained in:
1 parent
2fa4ffd074
commit
c958fc9799
5 files changed
+159
-64
No files matched your search
@@ -1130,6 +1130,23 @@ impl AgentDriverClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_table_comment<T: DeserializeOwned + Send + 'static>(
|
||||
&mut self,
|
||||
database: &str,
|
||||
schema: &str,
|
||||
table: &str,
|
||||
timeout_duration: Option<Duration>,
|
||||
) -> Result<T, String> {
|
||||
// Kingbase Go exposes this driver-specific RPC without widening the common
|
||||
// agent protocol contract that every SQL agent is expected to implement.
|
||||
self.call_with_timeout(
|
||||
"get_table_comment",
|
||||
agent_schema_table_params(database, schema, table),
|
||||
timeout_duration,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn list_indexes<T: DeserializeOwned + Send + 'static>(
|
||||
&mut self,
|
||||
database: &str,
|
||||
|
||||
@@ -1303,6 +1303,12 @@ pub async fn get_table_comment_core(
|
||||
.await?;
|
||||
return oracle_table_comment_from_query_result(result);
|
||||
}
|
||||
if db_config.as_ref().is_some_and(|config| config.db_type == DatabaseType::Kingbase) {
|
||||
let timeout = agent_metadata_timeout(db_config.as_ref());
|
||||
drop(connections);
|
||||
let mut client = client.lock().await;
|
||||
return client.get_table_comment::<Option<String>>(database, schema, table, timeout).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user