naivedogger commented on code in PR #5:
URL: https://github.com/apache/fluss-rust/pull/5#discussion_r2335950727
##########
crates/fluss/src/client/admin.rs:
##########
@@ -90,4 +124,245 @@ impl FlussAdmin {
modified_time,
))
}
+
+ /// List all tables in the given database
+ pub async fn list_tables(&self, database_name: &str) ->
Result<Vec<String>> {
+ let response = self
+ .admin_gateway
+ .request(ListTablesRequest::new(database_name)?)
+ .await?;
+ Ok(response.table_name)
+ }
+
+ /// Check if a table exists
+ pub async fn table_exists(&self, table_path: &TablePath) -> Result<bool> {
+ let response = self
+ .admin_gateway
+ .request(TableExistsRequest::new(table_path)?)
+ .await?;
+ Ok(response.exists)
+ }
+
+ /// Drop a database
+ pub async fn drop_database(
+ &self,
+ database_name: &str,
+ ignore_if_not_exists: bool,
+ cascade: bool,
+ ) -> Result<()> {
+ let _response = self
+ .admin_gateway
+ .request(DropDatabaseRequest::new(database_name,
ignore_if_not_exists, cascade)?)
Review Comment:
fixed
##########
crates/fluss/src/client/admin.rs:
##########
@@ -90,4 +124,245 @@ impl FlussAdmin {
modified_time,
))
}
+
+ /// List all tables in the given database
+ pub async fn list_tables(&self, database_name: &str) ->
Result<Vec<String>> {
+ let response = self
+ .admin_gateway
+ .request(ListTablesRequest::new(database_name)?)
+ .await?;
+ Ok(response.table_name)
+ }
+
+ /// Check if a table exists
+ pub async fn table_exists(&self, table_path: &TablePath) -> Result<bool> {
+ let response = self
+ .admin_gateway
+ .request(TableExistsRequest::new(table_path)?)
+ .await?;
+ Ok(response.exists)
+ }
+
+ /// Drop a database
+ pub async fn drop_database(
+ &self,
+ database_name: &str,
+ ignore_if_not_exists: bool,
+ cascade: bool,
+ ) -> Result<()> {
+ let _response = self
+ .admin_gateway
+ .request(DropDatabaseRequest::new(database_name,
ignore_if_not_exists, cascade)?)
+ .await?;
+ Ok(())
+ }
+
+ /// List all databases
+ pub async fn list_databases(&self) -> Result<Vec<String>> {
+ let response = self
+ .admin_gateway
+ .request(ListDatabasesRequest::new()?)
+ .await?;
+ Ok(response.database_name)
+ }
+
+ /// Check if a database exists
+ pub async fn database_exists(&self, database_name: &str) -> Result<bool> {
+ let response = self
+ .admin_gateway
+ .request(DatabaseExistsRequest::new(database_name)?)
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]