couchbase 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +73 -4
- data/ext/build_config.hxx.in +2 -0
- data/ext/build_version.hxx.in +11 -8
- data/ext/cmake/BuildTracing.cmake +1 -1
- data/ext/cmake/CompilerWarnings.cmake +5 -0
- data/ext/cmake/Testing.cmake +3 -6
- data/ext/couchbase/bucket.hxx +9 -1
- data/ext/couchbase/cbsasl/client.h +1 -1
- data/ext/couchbase/cluster.hxx +89 -6
- data/ext/couchbase/configuration.hxx +2 -0
- data/ext/couchbase/couchbase.cxx +1647 -507
- data/ext/couchbase/diagnostics.hxx +0 -3
- data/ext/couchbase/io/dns_client.hxx +2 -2
- data/ext/couchbase/io/http_command.hxx +6 -3
- data/ext/couchbase/io/http_session.hxx +14 -18
- data/ext/couchbase/io/http_session_manager.hxx +83 -2
- data/ext/couchbase/io/mcbp_command.hxx +4 -1
- data/ext/couchbase/io/mcbp_context.hxx +37 -0
- data/ext/couchbase/io/mcbp_session.hxx +91 -30
- data/ext/couchbase/operations.hxx +5 -0
- data/ext/couchbase/operations/analytics_dataset_create.hxx +3 -2
- data/ext/couchbase/operations/analytics_dataset_drop.hxx +3 -2
- data/ext/couchbase/operations/analytics_dataset_get_all.hxx +3 -2
- data/ext/couchbase/operations/analytics_dataverse_create.hxx +3 -2
- data/ext/couchbase/operations/analytics_dataverse_drop.hxx +3 -2
- data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +3 -2
- data/ext/couchbase/operations/analytics_index_create.hxx +3 -2
- data/ext/couchbase/operations/analytics_index_drop.hxx +3 -2
- data/ext/couchbase/operations/analytics_index_get_all.hxx +5 -2
- data/ext/couchbase/operations/analytics_link_connect.hxx +3 -2
- data/ext/couchbase/operations/analytics_link_disconnect.hxx +3 -2
- data/ext/couchbase/operations/bucket_create.hxx +3 -2
- data/ext/couchbase/operations/bucket_drop.hxx +3 -2
- data/ext/couchbase/operations/bucket_flush.hxx +3 -2
- data/ext/couchbase/operations/bucket_get.hxx +3 -2
- data/ext/couchbase/operations/bucket_get_all.hxx +3 -2
- data/ext/couchbase/operations/bucket_update.hxx +3 -2
- data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +3 -2
- data/ext/couchbase/operations/collection_create.hxx +3 -2
- data/ext/couchbase/operations/collection_drop.hxx +3 -2
- data/ext/couchbase/operations/collections_manifest_get.hxx +3 -2
- data/ext/couchbase/operations/document_analytics.hxx +3 -2
- data/ext/couchbase/operations/document_append.hxx +77 -0
- data/ext/couchbase/operations/document_decrement.hxx +3 -2
- data/ext/couchbase/operations/document_exists.hxx +3 -2
- data/ext/couchbase/operations/document_get.hxx +3 -2
- data/ext/couchbase/operations/document_get_and_lock.hxx +3 -2
- data/ext/couchbase/operations/document_get_and_touch.hxx +3 -2
- data/ext/couchbase/operations/document_get_projected.hxx +3 -2
- data/ext/couchbase/operations/document_increment.hxx +3 -2
- data/ext/couchbase/operations/document_insert.hxx +3 -2
- data/ext/couchbase/operations/document_lookup_in.hxx +8 -2
- data/ext/couchbase/operations/document_mutate_in.hxx +13 -2
- data/ext/couchbase/operations/document_prepend.hxx +77 -0
- data/ext/couchbase/operations/document_query.hxx +3 -2
- data/ext/couchbase/operations/document_remove.hxx +5 -2
- data/ext/couchbase/operations/document_replace.hxx +3 -2
- data/ext/couchbase/operations/document_search.hxx +3 -2
- data/ext/couchbase/operations/document_touch.hxx +3 -2
- data/ext/couchbase/operations/document_unlock.hxx +3 -2
- data/ext/couchbase/operations/document_upsert.hxx +3 -2
- data/ext/couchbase/operations/document_view.hxx +3 -2
- data/ext/couchbase/operations/group_drop.hxx +3 -2
- data/ext/couchbase/operations/group_get.hxx +3 -2
- data/ext/couchbase/operations/group_get_all.hxx +3 -2
- data/ext/couchbase/operations/group_upsert.hxx +3 -2
- data/ext/couchbase/operations/http_noop.hxx +78 -0
- data/ext/couchbase/operations/mcbp_noop.hxx +61 -0
- data/ext/couchbase/operations/query_index_build_deferred.hxx +3 -2
- data/ext/couchbase/operations/query_index_create.hxx +3 -2
- data/ext/couchbase/operations/query_index_drop.hxx +3 -2
- data/ext/couchbase/operations/query_index_get_all.hxx +3 -2
- data/ext/couchbase/operations/role_get_all.hxx +3 -2
- data/ext/couchbase/operations/scope_create.hxx +3 -2
- data/ext/couchbase/operations/scope_drop.hxx +3 -2
- data/ext/couchbase/operations/scope_get_all.hxx +3 -2
- data/ext/couchbase/operations/search_get_stats.hxx +3 -2
- data/ext/couchbase/operations/search_index_analyze_document.hxx +3 -2
- data/ext/couchbase/operations/search_index_control_ingest.hxx +3 -2
- data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +3 -2
- data/ext/couchbase/operations/search_index_control_query.hxx +3 -2
- data/ext/couchbase/operations/search_index_drop.hxx +3 -2
- data/ext/couchbase/operations/search_index_get.hxx +3 -2
- data/ext/couchbase/operations/search_index_get_all.hxx +3 -2
- data/ext/couchbase/operations/search_index_get_documents_count.hxx +3 -2
- data/ext/couchbase/operations/search_index_get_stats.hxx +3 -2
- data/ext/couchbase/operations/search_index_upsert.hxx +3 -2
- data/ext/couchbase/operations/user_drop.hxx +3 -2
- data/ext/couchbase/operations/user_get.hxx +3 -2
- data/ext/couchbase/operations/user_get_all.hxx +3 -2
- data/ext/couchbase/operations/user_upsert.hxx +3 -2
- data/ext/couchbase/operations/view_index_drop.hxx +3 -2
- data/ext/couchbase/operations/view_index_get.hxx +3 -2
- data/ext/couchbase/operations/view_index_get_all.hxx +3 -2
- data/ext/couchbase/operations/view_index_upsert.hxx +3 -2
- data/ext/couchbase/platform/terminate_handler.cc +5 -2
- data/ext/couchbase/protocol/client_opcode.hxx +368 -0
- data/ext/couchbase/protocol/cmd_append.hxx +145 -0
- data/ext/couchbase/protocol/cmd_hello.hxx +1 -0
- data/ext/couchbase/protocol/cmd_lookup_in.hxx +11 -3
- data/ext/couchbase/protocol/cmd_mutate_in.hxx +46 -4
- data/ext/couchbase/protocol/cmd_noop.hxx +82 -0
- data/ext/couchbase/protocol/cmd_prepend.hxx +145 -0
- data/ext/couchbase/protocol/durability_level.hxx +16 -0
- data/ext/couchbase/protocol/hello_feature.hxx +9 -0
- data/ext/couchbase/protocol/unsigned_leb128.h +2 -2
- data/ext/couchbase/service_type.hxx +1 -1
- data/ext/couchbase/version.hxx +18 -4
- data/ext/extconf.rb +9 -6
- data/ext/test/CMakeLists.txt +5 -0
- data/ext/test/test_helper.hxx +3 -3
- data/ext/test/test_helper_native.hxx +2 -5
- data/ext/test/test_native_binary_operations.cxx +186 -0
- data/ext/test/test_native_diagnostics.cxx +54 -3
- data/ext/test/test_ruby_trivial_crud.cxx +1 -1
- data/lib/couchbase.rb +1 -0
- data/lib/couchbase/analytics_options.rb +1 -71
- data/lib/couchbase/binary_collection.rb +60 -22
- data/lib/couchbase/binary_collection_options.rb +0 -76
- data/lib/couchbase/bucket.rb +40 -36
- data/lib/couchbase/cluster.rb +89 -156
- data/lib/couchbase/collection.rb +290 -72
- data/lib/couchbase/collection_options.rb +30 -243
- data/lib/couchbase/datastructures/couchbase_list.rb +5 -16
- data/lib/couchbase/datastructures/couchbase_map.rb +5 -16
- data/lib/couchbase/datastructures/couchbase_queue.rb +5 -16
- data/lib/couchbase/datastructures/couchbase_set.rb +5 -16
- data/lib/couchbase/diagnostics.rb +181 -0
- data/lib/couchbase/json_transcoder.rb +1 -1
- data/lib/couchbase/{common_options.rb → logger.rb} +24 -11
- data/lib/couchbase/management/query_index_manager.rb +1 -1
- data/lib/couchbase/management/user_manager.rb +3 -0
- data/lib/couchbase/options.rb +2094 -0
- data/lib/couchbase/query_options.rb +1 -144
- data/lib/couchbase/scope.rb +8 -25
- data/lib/couchbase/search_options.rb +0 -93
- data/lib/couchbase/version.rb +20 -1
- data/lib/couchbase/view_options.rb +1 -91
- metadata +19 -7
|
@@ -12,153 +12,10 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
require
|
|
15
|
+
require "json"
|
|
16
16
|
|
|
17
17
|
module Couchbase
|
|
18
18
|
class Cluster
|
|
19
|
-
class QueryOptions
|
|
20
|
-
# @return [Integer] Timeout in milliseconds
|
|
21
|
-
attr_accessor :timeout
|
|
22
|
-
|
|
23
|
-
# @return [Boolean] Allows turning this request into a prepared statement query
|
|
24
|
-
attr_accessor :adhoc
|
|
25
|
-
|
|
26
|
-
# @return [String] Provides a custom client context ID for this query
|
|
27
|
-
attr_accessor :client_context_id
|
|
28
|
-
|
|
29
|
-
# @return [Integer] Allows overriding the default maximum parallelism for the query execution on the server side.
|
|
30
|
-
attr_accessor :max_parallelism
|
|
31
|
-
|
|
32
|
-
# @return [Boolean] Allows explicitly marking a query as being readonly and not mutating any documents on the server side.
|
|
33
|
-
attr_accessor :readonly
|
|
34
|
-
|
|
35
|
-
# Allows customizing how long (in milliseconds) the query engine is willing to wait until the index catches up to whatever scan
|
|
36
|
-
# consistency is asked for in this query.
|
|
37
|
-
#
|
|
38
|
-
# @note that if +:not_bounded+ consistency level is used, this method doesn't do anything
|
|
39
|
-
# at all. If no value is provided to this method, the server default is used.
|
|
40
|
-
#
|
|
41
|
-
# @return [Integer] The maximum duration (in milliseconds) the query engine is willing to wait before failing.
|
|
42
|
-
attr_accessor :scan_wait
|
|
43
|
-
|
|
44
|
-
# @return [Integer] Supports customizing the maximum buffered channel size between the indexer and the query service
|
|
45
|
-
attr_accessor :scan_cap
|
|
46
|
-
|
|
47
|
-
# @return [Integer] Supports customizing the number of items execution operators can batch for fetch from the KV layer on the server.
|
|
48
|
-
attr_accessor :pipeline_batch
|
|
49
|
-
|
|
50
|
-
# @return [Integer] Allows customizing the maximum number of items each execution operator can buffer between various operators on the
|
|
51
|
-
# server.
|
|
52
|
-
attr_accessor :pipeline_cap
|
|
53
|
-
|
|
54
|
-
# @return [Boolean] Enables per-request metrics in the trailing section of the query
|
|
55
|
-
attr_accessor :metrics
|
|
56
|
-
|
|
57
|
-
# @return [:off, :phases, :timings] Customize server profile level for this query
|
|
58
|
-
attr_accessor :profile
|
|
59
|
-
|
|
60
|
-
# Tells the query engine to use a flex index (utilizing the search service)
|
|
61
|
-
#
|
|
62
|
-
# @api uncommitted
|
|
63
|
-
# @return [Boolean]
|
|
64
|
-
attr_accessor :flex_index
|
|
65
|
-
|
|
66
|
-
# Associate scope qualifier (also known as +query_context+) with the query.
|
|
67
|
-
#
|
|
68
|
-
# The qualifier must be in form +{bucket_name}.{scope_name}+ or +default:{bucket_name}.{scope_name}+.
|
|
69
|
-
#
|
|
70
|
-
# @api uncommitted
|
|
71
|
-
# @return [String]
|
|
72
|
-
attr_accessor :scope_qualifier
|
|
73
|
-
|
|
74
|
-
# @return [:not_bounded, :request_plus]
|
|
75
|
-
attr_reader :scan_consistency
|
|
76
|
-
|
|
77
|
-
# @api private
|
|
78
|
-
# @return [MutationState]
|
|
79
|
-
attr_reader :mutation_state
|
|
80
|
-
|
|
81
|
-
# @api private
|
|
82
|
-
# @return [Hash<String => #to_json>]
|
|
83
|
-
attr_reader :raw_parameters
|
|
84
|
-
|
|
85
|
-
# @yieldparam [QueryOptions] self
|
|
86
|
-
def initialize
|
|
87
|
-
@timeout = 75_000 # ms
|
|
88
|
-
@adhoc = true
|
|
89
|
-
@raw_parameters = {}
|
|
90
|
-
@positional_parameters = nil
|
|
91
|
-
@named_parameters = nil
|
|
92
|
-
@scan_consistency = nil
|
|
93
|
-
@mutation_state = nil
|
|
94
|
-
@scope_qualifier = nil
|
|
95
|
-
@flex_index = false
|
|
96
|
-
yield self if block_given?
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
# Allows providing custom JSON key/value pairs for advanced usage
|
|
100
|
-
#
|
|
101
|
-
# @param [String] key the parameter name (key of the JSON property)
|
|
102
|
-
# @param [Object] value the parameter value (value of the JSON property)
|
|
103
|
-
def raw(key, value)
|
|
104
|
-
@raw_parameters[key] = JSON.generate(value)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Customizes the consistency guarantees for this query
|
|
108
|
-
#
|
|
109
|
-
# @note overrides consistency level set by {#consistent_with}
|
|
110
|
-
#
|
|
111
|
-
# [+:not_bounded+] The indexer will return whatever state it has to the query engine at the time of query. This is the default (for
|
|
112
|
-
# single-statement requests).
|
|
113
|
-
#
|
|
114
|
-
# [+:request_plus+] The indexer will wait until all mutations have been processed at the time of request before returning to the query
|
|
115
|
-
# engine.
|
|
116
|
-
#
|
|
117
|
-
# @param [:not_bounded, :request_plus] level the index scan consistency to be used for this query
|
|
118
|
-
def scan_consistency=(level)
|
|
119
|
-
@mutation_state = nil if @mutation_state
|
|
120
|
-
@scan_consistency = level
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
# Sets the mutation tokens this query should be consistent with
|
|
124
|
-
#
|
|
125
|
-
# @note overrides consistency level set by {#scan_consistency=}
|
|
126
|
-
#
|
|
127
|
-
# @param [MutationState] mutation_state the mutation state containing the mutation tokens
|
|
128
|
-
def consistent_with(mutation_state)
|
|
129
|
-
@scan_consistency = nil if @scan_consistency
|
|
130
|
-
@mutation_state = mutation_state
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
# Sets positional parameters for the query
|
|
134
|
-
#
|
|
135
|
-
# @param [Array] positional the list of parameters that have to be substituted in the statement
|
|
136
|
-
def positional_parameters(positional)
|
|
137
|
-
@positional_parameters = positional
|
|
138
|
-
@named_parameters = nil
|
|
139
|
-
end
|
|
140
|
-
|
|
141
|
-
# @api private
|
|
142
|
-
# @return [Array<String>, nil]
|
|
143
|
-
def export_positional_parameters
|
|
144
|
-
@positional_parameters&.map { |p| JSON.dump(p) }
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# Sets named parameters for the query
|
|
148
|
-
#
|
|
149
|
-
# @param [Hash] named the key/value map of the parameters to substitute in the statement
|
|
150
|
-
def named_parameters(named)
|
|
151
|
-
@named_parameters = named
|
|
152
|
-
@positional_parameters = nil
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
# @api private
|
|
156
|
-
# @return [Hash<String => String>, nil]
|
|
157
|
-
def export_named_parameters
|
|
158
|
-
@named_parameters&.each_with_object({}) { |(n, v), o| o[n.to_s] = JSON.dump(v) }
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
|
|
162
19
|
class QueryResult
|
|
163
20
|
# @return [QueryMetaData] returns object representing additional metadata associated with this query
|
|
164
21
|
attr_accessor :meta_data
|
data/lib/couchbase/scope.rb
CHANGED
|
@@ -44,36 +44,19 @@ module Couchbase
|
|
|
44
44
|
#
|
|
45
45
|
# The query will be implicitly scoped using current bucket and scope names.
|
|
46
46
|
#
|
|
47
|
-
# @see
|
|
47
|
+
# @see Options::Query#scope_qualifier
|
|
48
48
|
# @see Cluster#query
|
|
49
49
|
#
|
|
50
50
|
# @param [String] statement the N1QL query statement
|
|
51
|
-
# @param [
|
|
51
|
+
# @param [Options::Query] options the custom options for this query
|
|
52
|
+
#
|
|
53
|
+
# @example Select first ten hotels from travel sample dataset
|
|
54
|
+
# cluster.query("SELECT * FROM `travel-sample` WHERE type = $type LIMIT 10",
|
|
55
|
+
# Options::Query(named_parameters: {type: "hotel"}, metrics: true))
|
|
52
56
|
#
|
|
53
57
|
# @return [QueryResult]
|
|
54
|
-
def query(statement, options =
|
|
55
|
-
resp = @backend.document_query(statement,
|
|
56
|
-
timeout: options.timeout,
|
|
57
|
-
adhoc: options.adhoc,
|
|
58
|
-
client_context_id: options.client_context_id,
|
|
59
|
-
max_parallelism: options.max_parallelism,
|
|
60
|
-
readonly: options.readonly,
|
|
61
|
-
flex_index: options.flex_index,
|
|
62
|
-
scan_wait: options.scan_wait,
|
|
63
|
-
scan_cap: options.scan_cap,
|
|
64
|
-
pipeline_batch: options.pipeline_batch,
|
|
65
|
-
pipeline_cap: options.pipeline_cap,
|
|
66
|
-
metrics: options.metrics,
|
|
67
|
-
profile: options.profile,
|
|
68
|
-
positional_parameters: options.export_positional_parameters,
|
|
69
|
-
named_parameters: options.export_named_parameters,
|
|
70
|
-
scope_name: @name,
|
|
71
|
-
bucket_name: @bucket_name,
|
|
72
|
-
scope_qualifier: options.scope_qualifier,
|
|
73
|
-
raw_parameters: options.raw_parameters,
|
|
74
|
-
scan_consistency: options.scan_consistency,
|
|
75
|
-
mutation_state: options.mutation_state&.to_a,
|
|
76
|
-
})
|
|
58
|
+
def query(statement, options = Options::Query.new)
|
|
59
|
+
resp = @backend.document_query(statement, options.to_backend(scope_name: @name, bucket_name: @bucket_name))
|
|
77
60
|
|
|
78
61
|
Cluster::QueryResult.new do |res|
|
|
79
62
|
res.meta_data = Cluster::QueryMetaData.new do |meta|
|
|
@@ -1206,99 +1206,6 @@ module Couchbase
|
|
|
1206
1206
|
end
|
|
1207
1207
|
end
|
|
1208
1208
|
|
|
1209
|
-
class SearchOptions
|
|
1210
|
-
# @return [Integer] Timeout in milliseconds
|
|
1211
|
-
attr_accessor :timeout
|
|
1212
|
-
|
|
1213
|
-
# @return [Integer] limits the number of matches returned from the complete result set.
|
|
1214
|
-
attr_accessor :limit
|
|
1215
|
-
|
|
1216
|
-
# @return [Integer] indicates how many matches are skipped on the result set before starting to return the matches
|
|
1217
|
-
attr_accessor :skip
|
|
1218
|
-
|
|
1219
|
-
# @return [Boolean] triggers inclusion of additional search result score explanations. (Default: +false+)
|
|
1220
|
-
attr_accessor :explain
|
|
1221
|
-
|
|
1222
|
-
# @return [:html, :ansi] the style of highlighting in the result excerpts (if not specified, the server default will be used)
|
|
1223
|
-
attr_accessor :highlight_style
|
|
1224
|
-
|
|
1225
|
-
# @return [Array<String>] list of the fields to highlight
|
|
1226
|
-
attr_accessor :highlight_fields
|
|
1227
|
-
|
|
1228
|
-
# @return [Array<String>] list of field values which should be retrieved for result documents, provided they were stored while
|
|
1229
|
-
# indexing
|
|
1230
|
-
attr_accessor :fields
|
|
1231
|
-
|
|
1232
|
-
# @return [:not_bounded] specifies level of consistency for the query
|
|
1233
|
-
attr_reader :scan_consistency
|
|
1234
|
-
|
|
1235
|
-
# @api private
|
|
1236
|
-
# @return [MutationState]
|
|
1237
|
-
attr_reader :mutation_state
|
|
1238
|
-
|
|
1239
|
-
# @api uncommitted
|
|
1240
|
-
# If set to true, the server will not perform any scoring on the hits
|
|
1241
|
-
# @return [Boolean]
|
|
1242
|
-
attr_accessor :disable_scoring
|
|
1243
|
-
|
|
1244
|
-
# Customizes the consistency guarantees for this query
|
|
1245
|
-
#
|
|
1246
|
-
# @note overrides consistency level set by {#consistent_with}
|
|
1247
|
-
#
|
|
1248
|
-
# [+:not_bounded+] The engine will return whatever state it has at the time of query
|
|
1249
|
-
#
|
|
1250
|
-
# @param [:not_bounded] level the scan consistency to be used for this query
|
|
1251
|
-
#
|
|
1252
|
-
# @return [void]
|
|
1253
|
-
def scan_consistency=(level)
|
|
1254
|
-
@mutation_state = nil if @mutation_state
|
|
1255
|
-
@scan_consistency = level
|
|
1256
|
-
end
|
|
1257
|
-
|
|
1258
|
-
# Sets the mutation tokens this query should be consistent with
|
|
1259
|
-
#
|
|
1260
|
-
# @note overrides consistency level set by {#scan_consistency=}
|
|
1261
|
-
#
|
|
1262
|
-
# @param [MutationState] mutation_state the mutation state containing the mutation tokens
|
|
1263
|
-
#
|
|
1264
|
-
# @return [void]
|
|
1265
|
-
def consistent_with(mutation_state)
|
|
1266
|
-
@scan_consistency = nil if @scan_consistency
|
|
1267
|
-
@mutation_state = mutation_state
|
|
1268
|
-
end
|
|
1269
|
-
|
|
1270
|
-
# Ordering rules to apply to the results
|
|
1271
|
-
#
|
|
1272
|
-
# The list might contain either strings or special objects, that derive from {SearchSort}.
|
|
1273
|
-
#
|
|
1274
|
-
# In case of String, the value represents the name of the field with optional +-+ in front of the name, which will turn on descending
|
|
1275
|
-
# mode for this field. One field is special is +"_score"+ which will sort results by their score.
|
|
1276
|
-
#
|
|
1277
|
-
# When nothing specified, the Server will order results by their score descending, which is equivalent of +"-_score"+.
|
|
1278
|
-
#
|
|
1279
|
-
# @return [Array<String, SearchSort>] list of ordering object
|
|
1280
|
-
attr_accessor :sort
|
|
1281
|
-
|
|
1282
|
-
# Facets allow to aggregate information collected on a particular result set
|
|
1283
|
-
#
|
|
1284
|
-
# @return [Hash<String => SearchFacet>]
|
|
1285
|
-
attr_accessor :facets
|
|
1286
|
-
|
|
1287
|
-
# @return [JsonTranscoder] transcoder to use for the results
|
|
1288
|
-
attr_accessor :transcoder
|
|
1289
|
-
|
|
1290
|
-
# @yieldparam [SearchOptions] self
|
|
1291
|
-
def initialize
|
|
1292
|
-
super
|
|
1293
|
-
@disable_scoring = false
|
|
1294
|
-
@explain = false
|
|
1295
|
-
@transcoder = JsonTranscoder.new
|
|
1296
|
-
@scan_consistency = nil
|
|
1297
|
-
@mutation_state = nil
|
|
1298
|
-
yield self if block_given?
|
|
1299
|
-
end
|
|
1300
|
-
end
|
|
1301
|
-
|
|
1302
1209
|
class SearchRowLocation
|
|
1303
1210
|
# @return [String]
|
|
1304
1211
|
attr_accessor :field
|
data/lib/couchbase/version.rb
CHANGED
|
@@ -13,6 +13,25 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
module Couchbase
|
|
16
|
+
# Version of the library and all bundled dependencies
|
|
17
|
+
#
|
|
18
|
+
# @example Display version and all dependencies in command line
|
|
19
|
+
# # ruby -rcouchbase -e 'pp Couchbase::VERSION'
|
|
20
|
+
# {:sdk=>"3.0.1",
|
|
21
|
+
# :backend=>"1.1.0",
|
|
22
|
+
# :build_timestamp=>"2020-10-05 11:19:50",
|
|
23
|
+
# :revision=>"b59cb40f11ec2dba992eda285eae5cd7238a59c3",
|
|
24
|
+
# :platform=>"Linux-4.15.0-66-generic",
|
|
25
|
+
# :cpu=>"x86_64",
|
|
26
|
+
# :cc=>"GNU 9.3.1",
|
|
27
|
+
# :cxx=>"GNU 9.3.1",
|
|
28
|
+
# :ruby=>"2.7.0",
|
|
29
|
+
# :spdlog=>"1.8.1",
|
|
30
|
+
# :asio=>"1.18.0",
|
|
31
|
+
# :snappy=>"1.1.8",
|
|
32
|
+
# :http_parser=>"2.9.4",
|
|
33
|
+
# :openssl_headers=>"OpenSSL 1.1.1c FIPS 28 May 2019",
|
|
34
|
+
# :openssl_runtime=>"OpenSSL 1.1.1c FIPS 28 May 2019"}
|
|
16
35
|
VERSION = {} unless defined?(VERSION) # rubocop:disable Style/MutableConstant
|
|
17
|
-
VERSION.update(:sdk => "3.0.
|
|
36
|
+
VERSION.update(:sdk => "3.0.2".freeze)
|
|
18
37
|
end
|
|
@@ -12,100 +12,10 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
require
|
|
15
|
+
require "json"
|
|
16
16
|
|
|
17
17
|
module Couchbase
|
|
18
18
|
class Bucket
|
|
19
|
-
class ViewOptions
|
|
20
|
-
# @return [Integer] Timeout in milliseconds
|
|
21
|
-
attr_accessor :timeout
|
|
22
|
-
|
|
23
|
-
# Specifies the level of consistency for the query
|
|
24
|
-
# @return [:not_bounded, :request_plus, :update_after]
|
|
25
|
-
attr_accessor :scan_consistency
|
|
26
|
-
|
|
27
|
-
# Specifies the number of results to skip from the start of the result set
|
|
28
|
-
# @return [Integer]
|
|
29
|
-
attr_accessor :skip
|
|
30
|
-
|
|
31
|
-
# Specifies the maximum number of results to return
|
|
32
|
-
# @return [Integer]
|
|
33
|
-
attr_accessor :limit
|
|
34
|
-
|
|
35
|
-
# Specifies the key, to which the engine has to skip before result generation
|
|
36
|
-
attr_accessor :start_key
|
|
37
|
-
|
|
38
|
-
# Specifies the key, at which the result generation has to be stopped
|
|
39
|
-
# @return [#to_json]
|
|
40
|
-
attr_accessor :end_key
|
|
41
|
-
|
|
42
|
-
# Specifies the document id in case {#start_key} gives multiple results within the index
|
|
43
|
-
# @return [String]
|
|
44
|
-
attr_accessor :start_key_doc_id
|
|
45
|
-
|
|
46
|
-
# Specifies the document id in case {#end_key} gives multiple results within the index
|
|
47
|
-
# @return [String]
|
|
48
|
-
attr_accessor :end_key_doc_id
|
|
49
|
-
|
|
50
|
-
# Specifies whether the {#end_key}/#{#end_key_doc_id} values should be inclusive
|
|
51
|
-
# @return [Boolean]
|
|
52
|
-
attr_accessor :inclusive_end
|
|
53
|
-
|
|
54
|
-
# Specifies whether to enable grouping of the results
|
|
55
|
-
#
|
|
56
|
-
# @return [Boolean]
|
|
57
|
-
attr_accessor :group
|
|
58
|
-
|
|
59
|
-
# Specifies the depth within the key to group the results
|
|
60
|
-
#
|
|
61
|
-
# @return [Integer]
|
|
62
|
-
attr_accessor :group_level
|
|
63
|
-
|
|
64
|
-
# Specifies the set of the keys to fetch from the index
|
|
65
|
-
# @return [#to_json]
|
|
66
|
-
attr_accessor :key
|
|
67
|
-
|
|
68
|
-
# Specifies set of the keys to fetch from the index
|
|
69
|
-
#
|
|
70
|
-
# @return [Array<#to_json>]
|
|
71
|
-
attr_accessor :keys
|
|
72
|
-
|
|
73
|
-
# Specifies the order of the results that should be returned
|
|
74
|
-
#
|
|
75
|
-
# @return [:ascending, :descending]
|
|
76
|
-
attr_accessor :order
|
|
77
|
-
|
|
78
|
-
# Specifies whether to enable the reduction function associated with this particular view index
|
|
79
|
-
# @return [Boolean]
|
|
80
|
-
attr_accessor :reduce
|
|
81
|
-
|
|
82
|
-
# Specifies the behaviour of the view engine should an error occur during the gathering of view index results
|
|
83
|
-
# which would result in only partial results being available
|
|
84
|
-
#
|
|
85
|
-
# @return [:stop, :continue]
|
|
86
|
-
attr_accessor :on_error
|
|
87
|
-
|
|
88
|
-
# @return [Boolean] allows to return debug information as part of the view response
|
|
89
|
-
attr_accessor :debug
|
|
90
|
-
|
|
91
|
-
# @return [:production, :development]
|
|
92
|
-
attr_accessor :namespace
|
|
93
|
-
|
|
94
|
-
# @yieldparam [ViewOptions] self
|
|
95
|
-
def initialize
|
|
96
|
-
@namespace = :production
|
|
97
|
-
yield self if block_given?
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# Allows providing custom JSON key/value pairs for advanced usage
|
|
101
|
-
#
|
|
102
|
-
# @param [String] key the parameter name (key of the JSON property)
|
|
103
|
-
# @param [Object] value the parameter value (value of the JSON property)
|
|
104
|
-
def raw(key, value)
|
|
105
|
-
@raw_parameters[key] = JSON.generate(value)
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
|
|
109
19
|
class ViewRow
|
|
110
20
|
# @return [String]
|
|
111
21
|
attr_accessor :id
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: couchbase
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergey Avseyev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Modern SDK for Couchbase Server
|
|
14
14
|
email:
|
|
@@ -72,6 +72,7 @@ files:
|
|
|
72
72
|
- ext/couchbase/io/http_session.hxx
|
|
73
73
|
- ext/couchbase/io/http_session_manager.hxx
|
|
74
74
|
- ext/couchbase/io/mcbp_command.hxx
|
|
75
|
+
- ext/couchbase/io/mcbp_context.hxx
|
|
75
76
|
- ext/couchbase/io/mcbp_message.hxx
|
|
76
77
|
- ext/couchbase/io/mcbp_parser.hxx
|
|
77
78
|
- ext/couchbase/io/mcbp_session.hxx
|
|
@@ -108,6 +109,7 @@ files:
|
|
|
108
109
|
- ext/couchbase/operations/collections_manifest_get.hxx
|
|
109
110
|
- ext/couchbase/operations/design_document.hxx
|
|
110
111
|
- ext/couchbase/operations/document_analytics.hxx
|
|
112
|
+
- ext/couchbase/operations/document_append.hxx
|
|
111
113
|
- ext/couchbase/operations/document_decrement.hxx
|
|
112
114
|
- ext/couchbase/operations/document_exists.hxx
|
|
113
115
|
- ext/couchbase/operations/document_get.hxx
|
|
@@ -118,6 +120,7 @@ files:
|
|
|
118
120
|
- ext/couchbase/operations/document_insert.hxx
|
|
119
121
|
- ext/couchbase/operations/document_lookup_in.hxx
|
|
120
122
|
- ext/couchbase/operations/document_mutate_in.hxx
|
|
123
|
+
- ext/couchbase/operations/document_prepend.hxx
|
|
121
124
|
- ext/couchbase/operations/document_query.hxx
|
|
122
125
|
- ext/couchbase/operations/document_remove.hxx
|
|
123
126
|
- ext/couchbase/operations/document_replace.hxx
|
|
@@ -130,6 +133,8 @@ files:
|
|
|
130
133
|
- ext/couchbase/operations/group_get.hxx
|
|
131
134
|
- ext/couchbase/operations/group_get_all.hxx
|
|
132
135
|
- ext/couchbase/operations/group_upsert.hxx
|
|
136
|
+
- ext/couchbase/operations/http_noop.hxx
|
|
137
|
+
- ext/couchbase/operations/mcbp_noop.hxx
|
|
133
138
|
- ext/couchbase/operations/query_index_build_deferred.hxx
|
|
134
139
|
- ext/couchbase/operations/query_index_create.hxx
|
|
135
140
|
- ext/couchbase/operations/query_index_drop.hxx
|
|
@@ -175,6 +180,7 @@ files:
|
|
|
175
180
|
- ext/couchbase/protocol/client_opcode.hxx
|
|
176
181
|
- ext/couchbase/protocol/client_request.hxx
|
|
177
182
|
- ext/couchbase/protocol/client_response.hxx
|
|
183
|
+
- ext/couchbase/protocol/cmd_append.hxx
|
|
178
184
|
- ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx
|
|
179
185
|
- ext/couchbase/protocol/cmd_decrement.hxx
|
|
180
186
|
- ext/couchbase/protocol/cmd_exists.hxx
|
|
@@ -191,6 +197,8 @@ files:
|
|
|
191
197
|
- ext/couchbase/protocol/cmd_insert.hxx
|
|
192
198
|
- ext/couchbase/protocol/cmd_lookup_in.hxx
|
|
193
199
|
- ext/couchbase/protocol/cmd_mutate_in.hxx
|
|
200
|
+
- ext/couchbase/protocol/cmd_noop.hxx
|
|
201
|
+
- ext/couchbase/protocol/cmd_prepend.hxx
|
|
194
202
|
- ext/couchbase/protocol/cmd_remove.hxx
|
|
195
203
|
- ext/couchbase/protocol/cmd_replace.hxx
|
|
196
204
|
- ext/couchbase/protocol/cmd_sasl_auth.hxx
|
|
@@ -217,9 +225,11 @@ files:
|
|
|
217
225
|
- ext/couchbase/utils/url_codec.hxx
|
|
218
226
|
- ext/couchbase/version.hxx
|
|
219
227
|
- ext/extconf.rb
|
|
228
|
+
- ext/test/CMakeLists.txt
|
|
220
229
|
- ext/test/test_helper.hxx
|
|
221
230
|
- ext/test/test_helper_native.hxx
|
|
222
231
|
- ext/test/test_helper_ruby.hxx
|
|
232
|
+
- ext/test/test_native_binary_operations.cxx
|
|
223
233
|
- ext/test/test_native_diagnostics.cxx
|
|
224
234
|
- ext/test/test_native_trivial_crud.cxx
|
|
225
235
|
- ext/test/test_ruby_trivial_crud.cxx
|
|
@@ -1320,14 +1330,15 @@ files:
|
|
|
1320
1330
|
- lib/couchbase/cluster.rb
|
|
1321
1331
|
- lib/couchbase/collection.rb
|
|
1322
1332
|
- lib/couchbase/collection_options.rb
|
|
1323
|
-
- lib/couchbase/common_options.rb
|
|
1324
1333
|
- lib/couchbase/datastructures.rb
|
|
1325
1334
|
- lib/couchbase/datastructures/couchbase_list.rb
|
|
1326
1335
|
- lib/couchbase/datastructures/couchbase_map.rb
|
|
1327
1336
|
- lib/couchbase/datastructures/couchbase_queue.rb
|
|
1328
1337
|
- lib/couchbase/datastructures/couchbase_set.rb
|
|
1338
|
+
- lib/couchbase/diagnostics.rb
|
|
1329
1339
|
- lib/couchbase/errors.rb
|
|
1330
1340
|
- lib/couchbase/json_transcoder.rb
|
|
1341
|
+
- lib/couchbase/logger.rb
|
|
1331
1342
|
- lib/couchbase/management/analytics_index_manager.rb
|
|
1332
1343
|
- lib/couchbase/management/bucket_manager.rb
|
|
1333
1344
|
- lib/couchbase/management/collection_manager.rb
|
|
@@ -1336,6 +1347,7 @@ files:
|
|
|
1336
1347
|
- lib/couchbase/management/user_manager.rb
|
|
1337
1348
|
- lib/couchbase/management/view_index_manager.rb
|
|
1338
1349
|
- lib/couchbase/mutation_state.rb
|
|
1350
|
+
- lib/couchbase/options.rb
|
|
1339
1351
|
- lib/couchbase/query_options.rb
|
|
1340
1352
|
- lib/couchbase/scope.rb
|
|
1341
1353
|
- lib/couchbase/search_options.rb
|
|
@@ -1349,9 +1361,9 @@ metadata:
|
|
|
1349
1361
|
homepage_uri: https://docs.couchbase.com/ruby-sdk/3.0/hello-world/start-using-sdk.html
|
|
1350
1362
|
bug_tracker_uri: https://couchbase.com/issues/browse/RCBC
|
|
1351
1363
|
mailing_list_uri: https://forums.couchbase.com/c/ruby-sdk
|
|
1352
|
-
source_code_uri: https://github.com/couchbase/couchbase-ruby-client/tree/3.0.
|
|
1353
|
-
changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.0.
|
|
1354
|
-
documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.0.
|
|
1364
|
+
source_code_uri: https://github.com/couchbase/couchbase-ruby-client/tree/3.0.2
|
|
1365
|
+
changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.0.2
|
|
1366
|
+
documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.0.2/index.html
|
|
1355
1367
|
github_repo: ssh://github.com/couchbase/couchbase-ruby-client
|
|
1356
1368
|
post_install_message:
|
|
1357
1369
|
rdoc_options:
|
|
@@ -1370,7 +1382,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1370
1382
|
- !ruby/object:Gem::Version
|
|
1371
1383
|
version: '0'
|
|
1372
1384
|
requirements: []
|
|
1373
|
-
rubygems_version: 3.1.
|
|
1385
|
+
rubygems_version: 3.1.4
|
|
1374
1386
|
signing_key:
|
|
1375
1387
|
specification_version: 4
|
|
1376
1388
|
summary: SDK for Couchbase Server
|