Couchbase C++ SDK 1.0.4 (rev. 5355b0f)
Loading...
Searching...
No Matches
transaction_query_options Class Reference

The transaction_query_options are options specific to a query. More...

#include <couchbase/transactions/transaction_query_options.hxx>

Public Member Functions

 transaction_query_options ()
 
template<typename Value >
auto raw (const std::string &key, const Value &value) -> transaction_query_options &
 Set an option which isn't exposed explicitly in transaction_query_options.
 
auto ad_hoc (bool value) -> transaction_query_options &
 Set ad_hoc.
 
auto scan_consistency (query_scan_consistency scan_consistency) -> transaction_query_options &
 Set the query_scan_consistency for this query.
 
auto profile (query_profile mode) -> transaction_query_options &
 Set the profile mode for this query.
 
auto client_context_id (const std::string &id) -> transaction_query_options &
 Set a client id for this query.
 
auto scan_wait (std::chrono::milliseconds scan_wait) -> transaction_query_options &
 Set the scan_wait time.
 
auto readonly (bool readonly) -> transaction_query_options &
 Set the readonly hint for this query.
 
auto scan_cap (std::uint64_t cap) -> transaction_query_options &
 Set the scan cap for this query.
 
auto pipeline_batch (std::uint64_t batch) -> transaction_query_options &
 Set pipeline_batch size for this query.
 
auto pipeline_cap (std::uint64_t cap) -> transaction_query_options &
 Set pipeline cap for this query.
 
template<typename... Parameters>
auto positional_parameters (const Parameters &... parameters)
 Set positional parameters for this query.
 
template<typename... Parameters>
auto named_parameters (const Parameters &... parameters) -> transaction_query_options &
 Set named parameters for this query.
 
auto metrics (bool metrics) -> transaction_query_options &
 Set metrics for this query.
 
auto max_parallelism (std::uint64_t max) -> transaction_query_options &
 Set max parallelism for this query.
 

Detailed Description

The transaction_query_options are options specific to a query.

Some of the options will override the corresponding elements in the transactions_query_config section of the transactions_config.

Constructor & Destructor Documentation

◆ transaction_query_options()

Member Function Documentation

◆ ad_hoc()

auto ad_hoc ( bool value) -> transaction_query_options&
inline

Set ad_hoc.

Inform query service that this query is, or is not, a prepared statement query.

See also
query_options::adhoc for detailed discussion.
Parameters
valueif set to false this query will be turned into a prepared statement query.
Returns
reference to this object, convenient for chaining calls.

◆ client_context_id()

auto client_context_id ( const std::string & id) -> transaction_query_options&
inline

Set a client id for this query.

See also
query_options::client_context_id for details.
Parameters
idDesired id
Returns
reference to this object, convenient for chaining calls.

◆ max_parallelism()

auto max_parallelism ( std::uint64_t max) -> transaction_query_options&
inline

Set max parallelism for this query.

See also
query_options::max_parallelism for details.
Parameters
maxDesired max parallelism
Returns
reference to this object, convenient for chaining calls.

◆ metrics()

auto metrics ( bool metrics) -> transaction_query_options&
inline

Set metrics for this query.

If true, the query results will contain metrics. This is true by default for transactional queries.

See also
query_options::metrics for details.
Parameters
metricsTrue if metrics are desired.
Returns
reference to this object, convenient for chaining calls.

◆ named_parameters()

template<typename... Parameters>
auto named_parameters ( const Parameters &... parameters) -> transaction_query_options&
inline

Set named parameters for this query.

See also
query_options::named_parameters for details.
Template Parameters
ParametersTypes of the parameter pairs.
Parameters
parametersthe sequence of name-value pairs. Each value will be encoded into JSON.
Returns
reference to this object, convenient for chaining calls.

◆ pipeline_batch()

auto pipeline_batch ( std::uint64_t batch) -> transaction_query_options&
inline

Set pipeline_batch size for this query.

See also
query_options::pipeline_batch for details.
Parameters
batchdesired batch size.
Returns
reference to this object, convenient for chaining calls.

◆ pipeline_cap()

auto pipeline_cap ( std::uint64_t cap) -> transaction_query_options&
inline

Set pipeline cap for this query.

See also
query_options::pipeline_cap for details.
Parameters
capdesired cap.
Returns
reference to this object, convenient for chaining calls.

◆ positional_parameters()

template<typename... Parameters>
auto positional_parameters ( const Parameters &... parameters)
inline

Set positional parameters for this query.

See also
query_options::positional_parameters for details.
Template Parameters
ParametersTypes of the parameters
Parameters
parametersthe sequence of positional parameters for this query.
Returns
reference to this object, convenient for chaining calls.

◆ profile()

auto profile ( query_profile mode) -> transaction_query_options&
inline

Set the profile mode for this query.

See also
query_options::profile for details.
Parameters
modedesired profile mode.
Returns
reference to this object, convenient for chaining calls.

◆ raw()

template<typename Value >
auto raw ( const std::string & key,
const Value & value ) -> transaction_query_options&
inline

Set an option which isn't exposed explicitly in transaction_query_options.

See also
query_options::raw for details.
Template Parameters
Valuetype of the value.
Parameters
keyThe name of the option.
valueThe value of this option.
Returns
reference to this object, convenient for chaining calls.

◆ readonly()

auto readonly ( bool readonly) -> transaction_query_options&
inline

Set the readonly hint for this query.

See also
query_options::readonly
Parameters
readonlyTrue if query doesn't mutate documents.
Returns
reference to this object, convenient for chaining calls.

◆ scan_cap()

auto scan_cap ( std::uint64_t cap) -> transaction_query_options&
inline

Set the scan cap for this query.

See also
query_options::scan_cap for details.
Parameters
capDesired cap.
Returns
reference to this object, convenient for chaining calls.

◆ scan_consistency()

auto scan_consistency ( query_scan_consistency scan_consistency) -> transaction_query_options&
inline

Set the query_scan_consistency for this query.

See also
query_options::scan_consistency for details.
Parameters
scan_consistencyDesired scan consistency.
Returns
reference to this object, convenient for chaining calls.

◆ scan_wait()

auto scan_wait ( std::chrono::milliseconds scan_wait) -> transaction_query_options&
inline

Set the scan_wait time.

See also
query_options::scan_wait for details.
Parameters
scan_waitDesired time for scan_wait.
Returns
reference to this object, convenient for chaining calls.

The documentation for this class was generated from the following file: