Method GetQueryAsyncEnumerable
GetQueryAsyncEnumerable(String, QueryOptions, CancellationToken)
Declaration
public IAsyncEnumerable<QueryResult<RecordValue>> GetQueryAsyncEnumerable(string statement, QueryOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
String |
statement |
Query SQL statement. |
QueryOptions |
options |
(Optional) Options for the Query
operation. If not specified or null , appropriate defaults
will be used. See QueryOptions. |
CancellationToken |
cancellationToken |
(Optional) Cancellation token.
|
Returns
Examples
Asynchronously iterating over
GetQueryAsyncEnumerable.
await foreach(var result in client.GetQueryAsyncEnumerable(
"SELECT * FROM myTable"))
{
foreach(var row in result.Rows)
{
// row is an instance of RecordValue
Console.WriteLine($"Id: {row["id"]}, Name: {row["name"]}");
}
}
Exceptions
See Also
GetQueryAsyncEnumerable(PreparedStatement, QueryOptions, CancellationToken)
Declaration
public IAsyncEnumerable<QueryResult<RecordValue>> GetQueryAsyncEnumerable(PreparedStatement preparedStatement, QueryOptions options = null, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
PreparedStatement |
preparedStatement |
Prepared query statement. |
QueryOptions |
options |
(Optional) Options for the Query
operation. If not specified or null , appropriate defaults
will be used. See QueryOptions. |
CancellationToken |
cancellationToken |
(Optional) Cancellation token.
|
Returns
Exceptions
Type |
Condition |
ArgumentException |
If
preparedStatement is null or invalid or
options contains invalid values or if the
statement uses external variables and there is a variable that
was not bound or if a variable was bound that is not present in
the query.
|
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