Class QueryResult<TRow>
Namespace: Oracle.NoSQL.SDK
Assembly: Oracle.NoSQL.SDK.dll
Syntax
public class QueryResult<TRow> : Object
Type Parameters
Name | Description |
---|---|
TRow | The type of value representing the returned rows. Must be a reference type. Currently the only supported type is RecordValue. |
Remarks
This class represents the result of QueryAsync API and partial results when iterating with GetQueryAsyncEnumerable. It contains a list of row instances representing the query results.
The shape of the values is based on the schema implied by the query. For example, a query such as SELECT * FROM ... that returns an intact row will return values that conform to the schema of the table. Projections return instances that conform to the schema implied by the statement. UPDATE queries either return values based on a RETURNING clause or, by default, the number of rows affected by the UPDATE statement.
When using QueryAsync
API, if the value of
ContinuationKey is not null
,
there are additional results available. That value can be supplied as
ContinuationKey to the subsequent call to
QueryAsync to
continue the query. In general,
QueryAsync should be
called in a loop (until the continuation key becomes null
) to
get all the results, as described in
QueryAsync(String, QueryOptions, CancellationToken).
You don't need to set the continuation key if using
GetQueryAsyncEnumerable
since the continuation key is managed internally in this case.
It is possible that
QueryAsync
returns no rows in the result (Rows list is
empty) but still have a non-null continuation key. The same
situation may happen when using
GetQueryAsyncEnumerable
and no rows are returned on a given iteration of await foreach
loop. This may happen if the query reads the maximum amount of data
allowed in a single request without matching a query predicate. In
either case you should continue the query by calling
QueryAsync or
iterating via await foreach
to get results, if any exist.
It is also a normal situation if that the last call to
QueryAsync (when the
continuation key becomes null
) or the last iteration of
await foreach
loop returns no rows in the result. This could
happen if the last iteration returned all the remaining rows but was
stopped due to the limits on the data read or written during a
single request, so one more iteration was needed to find that no more
results are available.
Properties
Name | Description |
---|---|
ConsumedCapacity | Cloud Service/Cloud Simulator only. Gets capacity consumed by this operation. |
ContinuationKey | Gets the continuation key. |
Rows | Gets the list of query results. |