Method GetListTablesAsyncEnumerable
GetListTablesAsyncEnumerable(ListTablesOptions, CancellationToken)
Declaration
public IAsyncEnumerable<ListTablesResult> GetListTablesAsyncEnumerable(ListTablesOptions options, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ListTablesOptions | options | Options for this operation. Specify Limit parameter to enable paging as well as other options as needed. |
| CancellationToken | cancellationToken | (Optional) Cancellation token.
You may also use
WithCancellation<T>(IAsyncEnumerable<T>, CancellationToken)
extension to pass the cancellation token to the resulting
IAsyncEnumerable<T> instead of
cancellationToken parameter. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<ListTablesResult> | Async enumerable to iterate over ListTablesResult objects. |
Remarks
Use this API when a given identity has access to a large number of tables and you wish to page the results rather than returning the whole list at once.
This API is similar to
ListTablesAsync(ListTablesOptions, CancellationToken)
but creates IAsyncEnumerable<T> that allows you to
iterate over the results using await foreach
construct. Each of the results is ListTablesResult
containing partial list of table names. Note that you must
specify Limit which will set
a limit on the number table names in each partial result
(otherwise the first partial result will contain the whole list).
The table names are returned in alphabetical order.
Note that this method may only throw ArgumentException. Other exceptions listed can only be thrown during the iteration process as per deferred execution semantics of enumerables.
Examples
Asynchronously paging and printing table names.var options = new ListTablesOptions
{
Compartment = "my_compartment",
Limit = 100
};
await foreach(var result in client.GetListTablesAsyncEnumerable(options))
{
foreach(var tableName in result.TableNames)
{
Console.WriteLine(tableName);
}
}
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If options
contains invalid values. |
| TimeoutException | Operation has timed out. |
| InvalidOperationException | The service is not in a valid state to perform this operation. |
| NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |
See Also
GetListTablesAsyncEnumerable(int, string, CancellationToken)
Declaration
public IAsyncEnumerable<ListTablesResult> GetListTablesAsyncEnumerable(int limit, string compartmentOrNamespace = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | limit | Limit on number of tables in each partial result. Equivalent to Limit. Must be a positive value. |
| string | compartmentOrNamespace | (Optional) For Cloud Service, pass either compartment id or compartment path (see remarks section for NoSQLClient). For on-premise NoSQL database, pass namespace name. |
| CancellationToken | cancellationToken | (Optional) Cancellation token.
You may also use
WithCancellation<T>(IAsyncEnumerable<T>, CancellationToken)
extension to pass the cancellation token to the resulting
IAsyncEnumerable<T> instead of
cancellationToken parameter. |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<ListTablesResult> | Async enumerable to iterate over ListTablesResult objects. |
Remarks
limit and optional
compartmentOrNamespace to specify either
compartment name or path (Cloud Service only) or namespace
(on-premise NoSQL database only) and no other options are
required.Examples
Asynchronously paging and printing table names.await foreach(var result in client.GetListTablesAsyncEnumerable(100))
{
foreach(var tableName in result.TableNames)
{
Console.WriteLine(tableName);
}
}
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If limit or
compartmentOrNamespace are invalid. |
| TimeoutException | Operation has timed out. |
| InvalidOperationException | The service is not in a valid state to perform this operation. |
| NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |