66 std::map<std::string, codec::binary, std::less<>>
raw;
99 positional_parameters_,
365 client_context_id_.reset();
397 mutation_state_.clear();
423 mutation_state_ = state.tokens();
424 scan_consistency_.reset();
438 template<
typename Value>
455 template<
typename... Parameters>
458 named_parameters_.clear();
459 positional_parameters_.clear();
460 encode_positional_parameters(parameters...);
474 template<
typename... Parameters>
477 named_parameters_.clear();
478 positional_parameters_.clear();
479 encode_named_parameters(parameters...);
500 raw_ = std::move(options);
521 named_parameters_.clear();
522 positional_parameters_ = std::move(parameters);
543 named_parameters_ = std::move(parameters);
544 positional_parameters_.clear();
549 template<
typename Parameter,
typename... Rest>
550 void encode_positional_parameters(
const Parameter& parameter, Rest... args)
552 positional_parameters_.emplace_back(
554 if constexpr (
sizeof...(args) > 0) {
555 encode_positional_parameters(args...);
559 template<
typename Name,
typename Parameter,
typename... Rest>
560 void encode_named_parameters(
const std::pair<Name, Parameter>& parameter, Rest... args)
562 named_parameters_[parameter.first] =
564 if constexpr (
sizeof...(args) > 0) {
565 encode_named_parameters(args...);
570 bool metrics_{
false };
571 bool readonly_{
false };
572 bool flex_index_{
false };
573 bool preserve_expiry_{
false };
574 std::optional<bool> use_replica_{};
575 std::optional<std::uint64_t> max_parallelism_{};
576 std::optional<std::uint64_t> scan_cap_{};
577 std::optional<std::uint64_t> pipeline_batch_{};
578 std::optional<std::uint64_t> pipeline_cap_{};
579 std::optional<std::string> client_context_id_{};
580 std::optional<std::chrono::milliseconds> scan_wait_{};
581 std::optional<query_scan_consistency> scan_consistency_{};
582 std::vector<mutation_token> mutation_state_{};
583 std::optional<query_profile> profile_{};
584 std::vector<codec::binary> positional_parameters_{};
585 std::map<std::string, codec::binary, std::less<>> raw_{};
586 std::map<std::string, codec::binary, std::less<>> named_parameters_{};
static auto serialize(Document document) -> binary
Definition tao_json_serializer.hxx:47
Common options that used by most operations.
Definition common_options.hxx:37
auto self() -> query_options &
Allows to return the right options builder instance for child implementations.
Definition common_options.hxx:102
auto build_common_options() const -> built
Definition common_options.hxx:89
Aggregation of one or more mutation_tokens for specifying consistency requirements of N1QL or FTS que...
Definition mutation_state.hxx:35
Represents result of cluster::query() and scope::query() calls.
Definition query_result.hxx:35
std::vector< std::byte > binary
Definition encoded_value.hxx:25
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
query_profile
Definition query_profile.hxx:22
query_scan_consistency
Definition query_scan_consistency.hxx:22
@ not_bounded
The indexer will return whatever state it has to the query engine at the time of query.
std::function< void(error, query_result)> query_handler
The signature for the handler of the cluster::query() and scope::query() operations.
Definition query_options.hxx:595
Immutable value object representing consistent options.
Definition query_options.hxx:48
std::vector< mutation_token > mutation_state
Definition query_options.hxx:62
std::optional< std::uint64_t > max_parallelism
Definition query_options.hxx:55
std::map< std::string, codec::binary, std::less<> > named_parameters
Definition query_options.hxx:65
const bool metrics
Definition query_options.hxx:50
std::optional< query_scan_consistency > scan_consistency
Definition query_options.hxx:61
std::optional< query_profile > profile
Definition query_options.hxx:63
const bool readonly
Definition query_options.hxx:51
std::optional< std::chrono::milliseconds > scan_wait
Definition query_options.hxx:57
std::map< std::string, codec::binary, std::less<> > raw
Definition query_options.hxx:66
const bool adhoc
Definition query_options.hxx:49
std::optional< std::uint64_t > scan_cap
Definition query_options.hxx:56
std::optional< std::string > client_context_id
Definition query_options.hxx:60
std::optional< bool > use_replica
Definition query_options.hxx:54
const bool flex_index
Definition query_options.hxx:52
const bool preserve_expiry
Definition query_options.hxx:53
std::vector< codec::binary > positional_parameters
Definition query_options.hxx:64
std::optional< std::uint64_t > pipeline_batch
Definition query_options.hxx:58
std::optional< std::uint64_t > pipeline_cap
Definition query_options.hxx:59
Options for cluster::query() and scope::query().
Definition query_options.hxx:41
auto client_context_id(std::string client_context_id) -> query_options &
Supports providing a custom client context ID for this query.
Definition query_options.hxx:362
auto preserve_expiry(bool preserve_expiry) -> query_options &
Tells the query engine to preserve expiration values set on any documents modified by this query.
Definition query_options.hxx:231
auto positional_parameters(const Parameters &... parameters) -> query_options &
Set list of positional parameters for a query.
Definition query_options.hxx:456
auto encoded_raw_options(std::map< std::string, codec::binary, std::less<> > options) -> query_options &
Set map of raw options for a query.
Definition query_options.hxx:497
auto metrics(bool metrics) -> query_options &
Enables per-request metrics in the trailing section of the query.
Definition query_options.hxx:143
auto named_parameters(const Parameters &... parameters) -> query_options &
Set list of named parameters for a query.
Definition query_options.hxx:475
auto max_parallelism(std::uint64_t max_parallelism) -> query_options &
Allows overriding the default maximum parallelism for the query execution on the server side.
Definition query_options.hxx:266
auto encoded_named_parameters(std::map< std::string, codec::binary, std::less<> > parameters) -> query_options &
Set map of named parameters for a query.
Definition query_options.hxx:540
auto pipeline_cap(std::uint64_t pipeline_cap) -> query_options &
Allows customizing the maximum number of items each execution operator can buffer between various ope...
Definition query_options.hxx:344
auto build() const -> built
Validates options and returns them as an immutable value.
Definition query_options.hxx:80
auto scan_wait(std::chrono::milliseconds wait) -> query_options &
Allows customizing how long the query engine is willing to wait until the index catches up to whateve...
Definition query_options.hxx:303
auto encoded_positional_parameters(std::vector< codec::binary > parameters) -> query_options &
Set list of positional parameters for a query.
Definition query_options.hxx:519
auto scan_cap(std::uint64_t scan_cap) -> query_options &
Supports customizing the maximum buffered channel size between the indexer and the query service.
Definition query_options.hxx:284
auto pipeline_batch(std::uint64_t pipeline_batch) -> query_options &
Supports customizing the number of items execution operators can batch for fetch from the KV layer on...
Definition query_options.hxx:325
auto readonly(bool readonly) -> query_options &
Allows explicitly marking a query as being readonly and not mutating and documents on the server side...
Definition query_options.hxx:198
auto use_replica(bool use_replica) -> query_options &
Specifies that the query engine should use replica nodes for KV fetches if the active node is down.
Definition query_options.hxx:248
auto adhoc(bool adhoc) -> query_options &
Allows turning this request into a prepared statement query.
Definition query_options.hxx:123
auto flex_index(bool flex_index) -> query_options &
Tells the query engine to use a flex index (utilizing the search service).
Definition query_options.hxx:213
auto raw(std::string name, const Value &value) -> query_options &
Definition query_options.hxx:439
auto consistent_with(const mutation_state &state) -> query_options &
Sets the mutation_tokens this query should be consistent with.
Definition query_options.hxx:421
auto scan_consistency(query_scan_consistency scan_consistency) -> query_options &
Customizes the consistency guarantees for this query.
Definition query_options.hxx:394
auto profile(query_profile profile) -> query_options &
Customizes the server profiling level for this query.
Definition query_options.hxx:165