Method ExecuteTableDDLWithCompletionAsync
ExecuteTableDDLWithCompletionAsync(String, TableDDLOptions, CancellationToken)
Declaration
public Task<TableResult> ExecuteTableDDLWithCompletionAsync(string statement, TableDDLOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | statement | SQL statement. |
TableDDLOptions | options | (Optional) Options for table DDL operation.
If not specified or null , appropriate defaults
will be used. See TableDDLOptions. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
This method is equivalent to calling ExecuteTableDDLAsync(String, TableDDLOptions, CancellationToken) and then calling WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) on the returned TableResult object. If the operation is successful, the table state in the resulting TableResult object should be either Active or Dropped (only if the operation was DROP TABLE).
For this operation, Timeout covers the total time interval including waiting for the DDL operation completion. If not specified, separate default timeouts are used for issuing the DDL operation and waiting for its completion, with values of TableDDLTimeout and TablePollTimeout correspondingly (the latter defaults to no timeout if TablePollTimeout is not set). Note that as with WaitForCompletionAsync(Nullable<TimeSpan>, Nullable<TimeSpan>, CancellationToken) you may specify poll delay as PollDelay which otherwise defaults to TablePollDelay.
Exceptions
Type | Condition |
---|---|
ArgumentException | If
statement is null or invalid
or options contains invalid values. |
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or 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
ExecuteTableDDLWithCompletionAsync(String, TableLimits, CancellationToken)
Declaration
public Task<TableResult> ExecuteTableDDLWithCompletionAsync(string statement, TableLimits tableLimits, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
String | statement | SQL statement. |
TableLimits | tableLimits | Table limits for table creation. |
CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
Examples
Create a table. We can ignore the return value since the result will represent successful completion of the table DDL operation (Active) or an exception will be thrown.try
{
await client.ExecuteTableDDLWithCompletionAsync(
"CREATE TABLE foo(id INTEGER, name STRING, PRIMARY KEY(id))",
new TableLimits(100, 100, 50));
Console.WriteLine("Table created.");
}
catch(Exception e)
{
Console.WriteLine($"Got exception: {e.Message}");
}
Exceptions
Type | Condition |
---|---|
ArgumentException | If
statement is null or invalid
or tableLimits is null or
contains invalid values.
|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or 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
ExecuteTableDDLWithCompletionAsync(String, CancellationToken)
Declaration
public Task<TableResult> ExecuteTableDDLWithCompletionAsync(string statement, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | statement | SQL statement. |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<TableResult> | Task returning TableResult. |
Remarks
Exceptions
Type | Condition |
---|---|
ArgumentException | If
statement is null or invalid.
|
TimeoutException | Operation has timed out. |
InvalidOperationException | The table or 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. |