couchbase 3.0.0.beta.1-universal-darwin-19 → 3.0.0-universal-darwin-19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +227 -0
- data/.rubocop_todo.yml +47 -0
- data/CONTRIBUTING.md +110 -0
- data/Gemfile +4 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/couchbase.gemspec +40 -39
- data/examples/analytics.rb +123 -108
- data/examples/auth.rb +33 -0
- data/examples/crud.rb +16 -2
- data/examples/managing_analytics_indexes.rb +18 -4
- data/examples/managing_buckets.rb +17 -3
- data/examples/managing_collections.rb +22 -9
- data/examples/managing_query_indexes.rb +38 -18
- data/examples/managing_search_indexes.rb +21 -6
- data/examples/managing_view_indexes.rb +18 -4
- data/examples/query.rb +17 -3
- data/examples/query_with_consistency.rb +30 -20
- data/examples/search.rb +116 -101
- data/examples/search_with_consistency.rb +43 -30
- data/examples/subdocument.rb +42 -30
- data/examples/view.rb +19 -10
- data/ext/CMakeLists.txt +40 -2
- data/ext/build_version.hxx.in +1 -1
- data/ext/couchbase/bucket.hxx +190 -38
- data/ext/couchbase/cluster.hxx +22 -4
- data/ext/couchbase/configuration.hxx +14 -14
- data/ext/couchbase/couchbase.cxx +108 -12
- data/ext/couchbase/error_map.hxx +202 -2
- data/ext/couchbase/errors.hxx +8 -2
- data/ext/couchbase/io/dns_client.hxx +6 -6
- data/ext/couchbase/io/http_command.hxx +2 -2
- data/ext/couchbase/io/http_session.hxx +7 -11
- data/ext/couchbase/io/http_session_manager.hxx +3 -3
- data/ext/couchbase/io/mcbp_command.hxx +101 -44
- data/ext/couchbase/io/mcbp_session.hxx +144 -49
- data/ext/couchbase/io/retry_action.hxx +30 -0
- data/ext/couchbase/io/retry_context.hxx +39 -0
- data/ext/couchbase/io/retry_orchestrator.hxx +96 -0
- data/ext/couchbase/io/retry_reason.hxx +235 -0
- data/ext/couchbase/io/retry_strategy.hxx +156 -0
- data/ext/couchbase/operations/document_decrement.hxx +2 -0
- data/ext/couchbase/operations/document_exists.hxx +2 -0
- data/ext/couchbase/operations/document_get.hxx +2 -0
- data/ext/couchbase/operations/document_get_and_lock.hxx +2 -0
- data/ext/couchbase/operations/document_get_and_touch.hxx +2 -0
- data/ext/couchbase/operations/document_get_projected.hxx +2 -0
- data/ext/couchbase/operations/document_increment.hxx +2 -0
- data/ext/couchbase/operations/document_insert.hxx +2 -0
- data/ext/couchbase/operations/document_lookup_in.hxx +2 -0
- data/ext/couchbase/operations/document_mutate_in.hxx +3 -0
- data/ext/couchbase/operations/document_query.hxx +10 -0
- data/ext/couchbase/operations/document_remove.hxx +2 -0
- data/ext/couchbase/operations/document_replace.hxx +2 -0
- data/ext/couchbase/operations/document_search.hxx +8 -3
- data/ext/couchbase/operations/document_touch.hxx +2 -0
- data/ext/couchbase/operations/document_unlock.hxx +2 -0
- data/ext/couchbase/operations/document_upsert.hxx +2 -0
- data/ext/couchbase/operations/query_index_create.hxx +14 -4
- data/ext/couchbase/operations/query_index_drop.hxx +12 -2
- data/ext/couchbase/operations/query_index_get_all.hxx +11 -2
- data/ext/couchbase/origin.hxx +47 -17
- data/ext/couchbase/platform/backtrace.c +189 -0
- data/ext/couchbase/platform/backtrace.h +54 -0
- data/ext/couchbase/platform/terminate_handler.cc +122 -0
- data/ext/couchbase/platform/terminate_handler.h +36 -0
- data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +6 -1
- data/ext/couchbase/protocol/status.hxx +14 -4
- data/ext/couchbase/version.hxx +2 -2
- data/ext/extconf.rb +39 -36
- data/ext/test/main.cxx +64 -16
- data/lib/couchbase.rb +0 -1
- data/lib/couchbase/analytics_options.rb +2 -4
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +9 -9
- data/lib/couchbase/binary_collection_options.rb +8 -6
- data/lib/couchbase/bucket.rb +18 -18
- data/lib/couchbase/cluster.rb +121 -90
- data/lib/couchbase/collection.rb +36 -38
- data/lib/couchbase/collection_options.rb +31 -17
- data/lib/couchbase/common_options.rb +1 -1
- data/lib/couchbase/datastructures/couchbase_list.rb +16 -16
- data/lib/couchbase/datastructures/couchbase_map.rb +18 -18
- data/lib/couchbase/datastructures/couchbase_queue.rb +13 -13
- data/lib/couchbase/datastructures/couchbase_set.rb +8 -7
- data/lib/couchbase/errors.rb +10 -3
- data/lib/couchbase/json_transcoder.rb +2 -2
- data/lib/couchbase/libcouchbase.bundle +0 -0
- data/lib/couchbase/management/analytics_index_manager.rb +37 -37
- data/lib/couchbase/management/bucket_manager.rb +25 -25
- data/lib/couchbase/management/collection_manager.rb +3 -3
- data/lib/couchbase/management/query_index_manager.rb +59 -14
- data/lib/couchbase/management/search_index_manager.rb +15 -12
- data/lib/couchbase/management/user_manager.rb +1 -1
- data/lib/couchbase/management/view_index_manager.rb +11 -5
- data/lib/couchbase/mutation_state.rb +12 -0
- data/lib/couchbase/query_options.rb +23 -9
- data/lib/couchbase/scope.rb +61 -1
- data/lib/couchbase/search_options.rb +40 -27
- data/lib/couchbase/subdoc.rb +31 -28
- data/lib/couchbase/version.rb +2 -2
- data/lib/couchbase/view_options.rb +0 -1
- metadata +20 -7
data/lib/couchbase/subdoc.rb
CHANGED
@@ -16,7 +16,8 @@ module Couchbase
|
|
16
16
|
class LookupInSpec
|
17
17
|
# Fetches the content from a field (if present) at the given path
|
18
18
|
#
|
19
|
-
# @param [String, Symbol] path the path identifying where to get the value. When path is a symbol, the library will try to expand it as
|
19
|
+
# @param [String, Symbol] path the path identifying where to get the value. When path is a symbol, the library will try to expand it as
|
20
|
+
# macro.
|
20
21
|
# @return [LookupInSpec]
|
21
22
|
def self.get(path)
|
22
23
|
case path
|
@@ -37,7 +38,7 @@ module Couchbase
|
|
37
38
|
new(:exists, path)
|
38
39
|
end
|
39
40
|
|
40
|
-
# Counts the number of values at a given path in
|
41
|
+
# Counts the number of values at a given path in the document
|
41
42
|
#
|
42
43
|
# @param [String] path the path identifying where to count the values
|
43
44
|
# @return [LookupInSpec]
|
@@ -57,8 +58,6 @@ module Couchbase
|
|
57
58
|
attr_reader :type
|
58
59
|
attr_reader :path
|
59
60
|
|
60
|
-
private
|
61
|
-
|
62
61
|
# @api private
|
63
62
|
#
|
64
63
|
# @param [Symbol] macro
|
@@ -86,6 +85,10 @@ module Couchbase
|
|
86
85
|
end
|
87
86
|
end
|
88
87
|
|
88
|
+
private_class_method :expand_macro
|
89
|
+
|
90
|
+
private
|
91
|
+
|
89
92
|
# @param [:get_doc, :get, :exists, :count] type of the lookup
|
90
93
|
# @param [String] path
|
91
94
|
def initialize(type, path)
|
@@ -242,9 +245,9 @@ module Couchbase
|
|
242
245
|
@expand_macros
|
243
246
|
end
|
244
247
|
|
245
|
-
CAS = "${Mutation.CAS}"
|
246
|
-
SEQ_NO = "${Mutation.seqno}"
|
247
|
-
VALUE_CRC32C = "${Mutation.value_crc32c}"
|
248
|
+
CAS = "${Mutation.CAS}".freeze
|
249
|
+
SEQ_NO = "${Mutation.seqno}".freeze
|
250
|
+
VALUE_CRC32C = "${Mutation.value_crc32c}".freeze
|
248
251
|
|
249
252
|
attr_reader :type
|
250
253
|
attr_reader :path
|
@@ -259,29 +262,29 @@ module Couchbase
|
|
259
262
|
@type = type
|
260
263
|
@path = path
|
261
264
|
@param =
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
265
|
+
case param
|
266
|
+
when :cas
|
267
|
+
CAS
|
268
|
+
when :seq_no, :sequence_number
|
269
|
+
SEQ_NO
|
270
|
+
when :value_crc32c, :value_crc
|
271
|
+
VALUE_CRC32C
|
272
|
+
else
|
273
|
+
param
|
274
|
+
end
|
272
275
|
@expand_macros = [CAS, SEQ_NO, VALUE_CRC32C].include?(@param)
|
273
276
|
@xattr = true if @expand_macros
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
277
|
+
return if @param.nil?
|
278
|
+
|
279
|
+
@param =
|
280
|
+
case type
|
281
|
+
when :counter
|
282
|
+
@param.to_i
|
283
|
+
when :array_push_first, :array_push_last, :array_insert
|
284
|
+
@param.map { |entry| JSON.generate(entry) }.join(",")
|
285
|
+
else
|
286
|
+
JSON.generate(@param)
|
287
|
+
end
|
285
288
|
end
|
286
289
|
end
|
287
290
|
end
|
data/lib/couchbase/version.rb
CHANGED
@@ -13,6 +13,6 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
module Couchbase
|
16
|
-
VERSION = {} unless defined?(VERSION)
|
17
|
-
VERSION.update(:sdk => "3.0.0
|
16
|
+
VERSION = {} unless defined?(VERSION) # rubocop:disable Style/MutableConstant
|
17
|
+
VERSION.update(:sdk => "3.0.0".freeze)
|
18
18
|
end
|
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.0
|
4
|
+
version: 3.0.0
|
5
5
|
platform: universal-darwin-19
|
6
6
|
authors:
|
7
7
|
- Sergey Avseyev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08
|
11
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Modern SDK for Couchbase Server
|
14
14
|
email:
|
@@ -17,13 +17,17 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- ".rubocop.yml"
|
21
|
+
- ".rubocop_todo.yml"
|
20
22
|
- ".yardopts"
|
23
|
+
- CONTRIBUTING.md
|
21
24
|
- Gemfile
|
22
25
|
- LICENSE.txt
|
23
26
|
- README.md
|
24
27
|
- Rakefile
|
25
28
|
- couchbase.gemspec
|
26
29
|
- examples/analytics.rb
|
30
|
+
- examples/auth.rb
|
27
31
|
- examples/crud.rb
|
28
32
|
- examples/managing_analytics_indexes.rb
|
29
33
|
- examples/managing_buckets.rb
|
@@ -88,6 +92,11 @@ files:
|
|
88
92
|
- ext/couchbase/io/mcbp_message.hxx
|
89
93
|
- ext/couchbase/io/mcbp_parser.hxx
|
90
94
|
- ext/couchbase/io/mcbp_session.hxx
|
95
|
+
- ext/couchbase/io/retry_action.hxx
|
96
|
+
- ext/couchbase/io/retry_context.hxx
|
97
|
+
- ext/couchbase/io/retry_orchestrator.hxx
|
98
|
+
- ext/couchbase/io/retry_reason.hxx
|
99
|
+
- ext/couchbase/io/retry_strategy.hxx
|
91
100
|
- ext/couchbase/io/streams.hxx
|
92
101
|
- ext/couchbase/mutation_token.hxx
|
93
102
|
- ext/couchbase/operations.hxx
|
@@ -154,12 +163,16 @@ files:
|
|
154
163
|
- ext/couchbase/operations/view_index_get_all.hxx
|
155
164
|
- ext/couchbase/operations/view_index_upsert.hxx
|
156
165
|
- ext/couchbase/origin.hxx
|
166
|
+
- ext/couchbase/platform/backtrace.c
|
167
|
+
- ext/couchbase/platform/backtrace.h
|
157
168
|
- ext/couchbase/platform/base64.cc
|
158
169
|
- ext/couchbase/platform/base64.h
|
159
170
|
- ext/couchbase/platform/random.cc
|
160
171
|
- ext/couchbase/platform/random.h
|
161
172
|
- ext/couchbase/platform/string_hex.cc
|
162
173
|
- ext/couchbase/platform/string_hex.h
|
174
|
+
- ext/couchbase/platform/terminate_handler.cc
|
175
|
+
- ext/couchbase/platform/terminate_handler.h
|
163
176
|
- ext/couchbase/platform/uuid.cc
|
164
177
|
- ext/couchbase/platform/uuid.h
|
165
178
|
- ext/couchbase/protocol/client_opcode.hxx
|
@@ -1432,9 +1445,9 @@ metadata:
|
|
1432
1445
|
homepage_uri: https://docs.couchbase.com/ruby-sdk/3.0/hello-world/start-using-sdk.html
|
1433
1446
|
bug_tracker_uri: https://couchbase.com/issues/browse/RCBC
|
1434
1447
|
mailing_list_uri: https://forums.couchbase.com/c/ruby-sdk
|
1435
|
-
source_code_uri: https://github.com/
|
1436
|
-
changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.0.0
|
1437
|
-
documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.0.0
|
1448
|
+
source_code_uri: https://github.com/couchbase/couchbase-ruby-client/tree/3.0.0
|
1449
|
+
changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.0.0
|
1450
|
+
documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.0.0/index.html
|
1438
1451
|
github_repo: ssh://github.com/couchbase/couchbase-ruby-client
|
1439
1452
|
post_install_message:
|
1440
1453
|
rdoc_options:
|
@@ -1449,9 +1462,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1449
1462
|
version: 2.6.0
|
1450
1463
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1451
1464
|
requirements:
|
1452
|
-
- - "
|
1465
|
+
- - ">="
|
1453
1466
|
- !ruby/object:Gem::Version
|
1454
|
-
version:
|
1467
|
+
version: '0'
|
1455
1468
|
requirements: []
|
1456
1469
|
rubygems_version: 3.0.3
|
1457
1470
|
signing_key:
|