Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCBC-442: Support query with read from replica #112

Merged
merged 1 commit into from Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/couchbase
Submodule couchbase updated 112 files
1 change: 1 addition & 0 deletions ext/couchbase.cxx
Expand Up @@ -3696,6 +3696,7 @@ cb_Backend_document_query(VALUE self, VALUE statement, VALUE options)
cb_extract_option_bool(req.readonly, options, "readonly");
cb_extract_option_bool(req.flex_index, options, "flex_index");
cb_extract_option_bool(req.preserve_expiry, options, "preserve_expiry");
cb_extract_option_bool(req.use_replica, options, "use_replica");
cb_extract_option_uint64(req.scan_cap, options, "scan_cap");
cb_extract_duration(req.scan_wait, options, "scan_wait");
cb_extract_option_uint64(req.max_parallelism, options, "max_parallelism");
Expand Down
6 changes: 6 additions & 0 deletions lib/couchbase/options.rb
Expand Up @@ -1849,6 +1849,7 @@ class Query < Base
attr_accessor :profile # @return [Symbol]
attr_accessor :flex_index # @return [Boolean]
attr_accessor :preserve_expiry # @return [Boolean]
attr_accessor :use_replica # @return [Boolean, nil]
attr_accessor :scope_qualifier # @return [String]
attr_accessor :transcoder # @return [JsonTranscoder, #decode(String)]

Expand Down Expand Up @@ -1894,6 +1895,8 @@ class Query < Base
# @param [Boolean, nil] flex_index Tells the query engine to use a flex index (utilizing the search service)
# @param [Boolean, nil] preserve_expiry Tells the query engine to preserve expiration values set on any documents
# modified by this query.
# @param [Boolean, nil] use_replica Specifies that the query engine should use replica nodes for KV fetches if
# the active node is down. If not provided, the server default will be used
# @param [String, nil] scope_qualifier Associate scope qualifier (also known as +query_context+) with the query.
# The qualifier must be in form +{bucket_name}.{scope_name}+ or +default:{bucket_name}.{scope_name}+.
# @param [JsonTranscoder] transcoder to decode rows
Expand Down Expand Up @@ -1925,6 +1928,7 @@ def initialize(adhoc: true,
profile: :off,
flex_index: nil,
preserve_expiry: nil,
use_replica: nil,
scope_qualifier: nil,
scan_consistency: :not_bounded,
mutation_state: nil,
Expand All @@ -1950,6 +1954,7 @@ def initialize(adhoc: true,
@profile = profile
@flex_index = flex_index
@preserve_expiry = preserve_expiry
@use_replica = use_replica
@scope_qualifier = scope_qualifier
@scan_consistency = scan_consistency
@mutation_state = mutation_state
Expand Down Expand Up @@ -2043,6 +2048,7 @@ def to_backend(scope_name: nil, bucket_name: nil)
readonly: @readonly,
flex_index: @flex_index,
preserve_expiry: @preserve_expiry,
use_replica: @use_replica,
scan_wait: Utils::Time.extract_duration(@scan_wait),
scan_cap: @scan_cap,
pipeline_batch: @pipeline_batch,
Expand Down