MCPcopy Create free account
hub / github.com/apache/paimon-rust / list_tables

Method list_tables

crates/paimon/src/api/rest_api.rs:273–292  ·  view source on GitHub ↗

List all tables in a database.

(&self, database: &str)

Source from the content-addressed store, hash-verified

271
272 /// List all tables in a database.
273 pub async fn list_tables(&self, database: &str) -> Result<Vec<String>> {
274 validate_non_empty(database, "database name")?;
275
276 let mut results = Vec::new();
277 let mut page_token: Option<String> = None;
278
279 loop {
280 let paged = self
281 .list_tables_paged(database, None, page_token.as_deref(), None, None)
282 .await?;
283 let is_empty = paged.elements.is_empty();
284 results.extend(paged.elements);
285 page_token = paged.next_page_token;
286 if page_token.is_none() || is_empty {
287 break;
288 }
289 }
290
291 Ok(results)
292 }
293
294 /// List tables with pagination.
295 pub async fn list_tables_paged(

Callers 1

mainFunction · 0.45

Calls 3

validate_non_emptyFunction · 0.85
list_tables_pagedMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected