@Stability.Internal public class QueryAccessor extends Object
Note that this accessor also transparently deals with prepared statements and the associated query cache.
Also, this class has internal functionality and is not intended to be called from the user directly.
Constructor and Description |
---|
QueryAccessor(Core core) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<QueryResult> |
queryAsync(QueryRequest request,
QueryOptions.Built options,
JsonSerializer serializer)
Performs a N1QL query and returns the result as a future.
|
Mono<ReactiveQueryResult> |
queryReactive(QueryRequest request,
QueryOptions.Built options,
JsonSerializer serializer)
Performs a N1QL query and returns the result as a future.
|
static QueryRequest |
targetedQueryRequest(String statement,
byte[] queryBytes,
String clientContextId,
NodeIdentifier target,
boolean readonly,
RetryStrategy retryStrategy,
Duration timeout,
RequestSpan parentSpan,
Core core)
Used by the transactions library, this provides some binary interface protection against
QueryRequest/TargetedQueryRequest changing.
|
public QueryAccessor(Core core)
public CompletableFuture<QueryResult> queryAsync(QueryRequest request, QueryOptions.Built options, JsonSerializer serializer)
Note that compared to the reactive method, this one collects the rows into a list and makes sure everything is part of the result. If you need backpressure, go with reactive.
request
- the request to perform.options
- query options to use.public Mono<ReactiveQueryResult> queryReactive(QueryRequest request, QueryOptions.Built options, JsonSerializer serializer)
request
- the request to perform.options
- query options to use.@Stability.Internal public static QueryRequest targetedQueryRequest(String statement, byte[] queryBytes, String clientContextId, @Nullable NodeIdentifier target, boolean readonly, RetryStrategy retryStrategy, Duration timeout, RequestSpan parentSpan, Core core)
Copyright © 2021 Couchbase, Inc.. All rights reserved.