List all partitions of a table, paging internally.
(&self, identifier: &Identifier)
| 380 | |
| 381 | /// List all partitions of a table, paging internally. |
| 382 | pub async fn list_partitions(&self, identifier: &Identifier) -> Result<Vec<Partition>> { |
| 383 | let database = identifier.database(); |
| 384 | let table = identifier.object(); |
| 385 | validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?; |
| 386 | |
| 387 | let mut results = Vec::new(); |
| 388 | let mut page_token: Option<String> = None; |
| 389 | |
| 390 | loop { |
| 391 | let paged = self |
| 392 | .list_partitions_paged(identifier, None, page_token.as_deref()) |
| 393 | .await?; |
| 394 | let is_empty = paged.elements.is_empty(); |
| 395 | results.extend(paged.elements); |
| 396 | page_token = paged.next_page_token; |
| 397 | if page_token.is_none() || is_empty { |
| 398 | break; |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | Ok(results) |
| 403 | } |
| 404 | |
| 405 | /// List partitions with pagination. |
| 406 | pub async fn list_partitions_paged( |
no test coverage detected