Method ListTablesAsync
ListTablesAsync(ListTablesOptions, CancellationToken)
Lists tables, returning table names.
Declaration
public Task<ListTablesResult> ListTablesAsync(ListTablesOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
ListTablesOptions | options | (Optional) Options for this operation, which
allow specifying paging as well as other parameters. If not
specified or null , appropriate defaults will be
used.
|
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<ListTablesResult> | Task returning ListTablesResult object containing table names. |
Remarks
If further information about a specific table is desired, GetTableAsync(String, GetTableOptions, CancellationToken) API may be used.
If a given identity has access to a large number of tables the list may be paged by either using FromIndex and Limit or by calling GetListTablesAsyncEnumerable(ListTablesOptions, CancellationToken) instead of this API. The table names are returned as string list in ListTablesResult in alphabetical order to facilitate paging.
Examples
Listing all tables in a default compartment/tenancy. var result = await client.ListTablesAsync();
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
ListTablesAsync(String, CancellationToken)
Lists tables, returning table names.
Declaration
public Task<ListTablesResult> ListTablesAsync(string compartmentOrNamespace, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | compartmentOrNamespace | For Cloud Service, pass either compartment id or compartment path (see remarks section for NoSQLClient). For on-premise database, pass namespace name. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<ListTablesResult> | Task returning ListTablesResult object containing table names. |
Remarks
This API is a shorthand for
ListTablesAsync(ListTablesOptions, CancellationToken)
that takes
compartmentOrNamespace
as the only
option to specify either compartment name or path (Cloud Service
only) or namespace (on-premise database only).
Examples
Listing all tables in a given compartment. var result = await client.ListTablesAsync("my_compartment");
foreach(var tableName in result.TableNames)
{
Console.WriteLine(tableName);
}
Exceptions
Type | Condition |
---|---|
ArgumentException | If
compartmentOrNamespace is missing or 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. |
See Also
ListTablesAsync(CancellationToken)
Lists tables, returning table names.
Declaration
public Task<ListTablesResult> ListTablesAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<ListTablesResult> | Task returning ListTablesResult object containing table names. |
Remarks
This API is a shorthand for
ListTablesAsync(ListTablesOptions, CancellationToken).
Use this overload when you need to provide
CancellationToken but you don't need to provide
ListTablesOptions.
Exceptions
Type | Condition |
---|---|
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. |