couchbase 3.0.0.beta.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +227 -0
  3. data/.rubocop_todo.yml +47 -0
  4. data/CONTRIBUTING.md +110 -0
  5. data/Gemfile +4 -0
  6. data/README.md +3 -3
  7. data/Rakefile +1 -1
  8. data/couchbase.gemspec +40 -39
  9. data/examples/analytics.rb +123 -108
  10. data/examples/auth.rb +33 -0
  11. data/examples/crud.rb +16 -2
  12. data/examples/managing_analytics_indexes.rb +18 -4
  13. data/examples/managing_buckets.rb +17 -3
  14. data/examples/managing_collections.rb +22 -9
  15. data/examples/managing_query_indexes.rb +38 -18
  16. data/examples/managing_search_indexes.rb +21 -6
  17. data/examples/managing_view_indexes.rb +18 -4
  18. data/examples/query.rb +17 -3
  19. data/examples/query_with_consistency.rb +30 -20
  20. data/examples/search.rb +116 -101
  21. data/examples/search_with_consistency.rb +43 -30
  22. data/examples/subdocument.rb +42 -30
  23. data/examples/view.rb +19 -10
  24. data/ext/CMakeLists.txt +40 -2
  25. data/ext/build_version.hxx.in +1 -1
  26. data/ext/couchbase/bucket.hxx +190 -38
  27. data/ext/couchbase/cluster.hxx +22 -4
  28. data/ext/couchbase/configuration.hxx +14 -14
  29. data/ext/couchbase/couchbase.cxx +108 -12
  30. data/ext/couchbase/error_map.hxx +202 -2
  31. data/ext/couchbase/errors.hxx +8 -2
  32. data/ext/couchbase/io/dns_client.hxx +6 -6
  33. data/ext/couchbase/io/http_command.hxx +2 -2
  34. data/ext/couchbase/io/http_session.hxx +7 -11
  35. data/ext/couchbase/io/http_session_manager.hxx +3 -3
  36. data/ext/couchbase/io/mcbp_command.hxx +101 -44
  37. data/ext/couchbase/io/mcbp_session.hxx +144 -49
  38. data/ext/couchbase/io/retry_action.hxx +30 -0
  39. data/ext/couchbase/io/retry_context.hxx +39 -0
  40. data/ext/couchbase/io/retry_orchestrator.hxx +96 -0
  41. data/ext/couchbase/io/retry_reason.hxx +235 -0
  42. data/ext/couchbase/io/retry_strategy.hxx +156 -0
  43. data/ext/couchbase/operations/document_decrement.hxx +2 -0
  44. data/ext/couchbase/operations/document_exists.hxx +2 -0
  45. data/ext/couchbase/operations/document_get.hxx +2 -0
  46. data/ext/couchbase/operations/document_get_and_lock.hxx +2 -0
  47. data/ext/couchbase/operations/document_get_and_touch.hxx +2 -0
  48. data/ext/couchbase/operations/document_get_projected.hxx +2 -0
  49. data/ext/couchbase/operations/document_increment.hxx +2 -0
  50. data/ext/couchbase/operations/document_insert.hxx +2 -0
  51. data/ext/couchbase/operations/document_lookup_in.hxx +2 -0
  52. data/ext/couchbase/operations/document_mutate_in.hxx +3 -0
  53. data/ext/couchbase/operations/document_query.hxx +10 -0
  54. data/ext/couchbase/operations/document_remove.hxx +2 -0
  55. data/ext/couchbase/operations/document_replace.hxx +2 -0
  56. data/ext/couchbase/operations/document_search.hxx +8 -3
  57. data/ext/couchbase/operations/document_touch.hxx +2 -0
  58. data/ext/couchbase/operations/document_unlock.hxx +2 -0
  59. data/ext/couchbase/operations/document_upsert.hxx +2 -0
  60. data/ext/couchbase/operations/query_index_create.hxx +14 -4
  61. data/ext/couchbase/operations/query_index_drop.hxx +12 -2
  62. data/ext/couchbase/operations/query_index_get_all.hxx +11 -2
  63. data/ext/couchbase/origin.hxx +47 -17
  64. data/ext/couchbase/platform/backtrace.c +189 -0
  65. data/ext/couchbase/platform/backtrace.h +54 -0
  66. data/ext/couchbase/platform/terminate_handler.cc +122 -0
  67. data/ext/couchbase/platform/terminate_handler.h +36 -0
  68. data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +6 -1
  69. data/ext/couchbase/protocol/status.hxx +14 -4
  70. data/ext/couchbase/version.hxx +2 -2
  71. data/ext/extconf.rb +39 -36
  72. data/ext/test/main.cxx +64 -16
  73. data/lib/couchbase.rb +0 -1
  74. data/lib/couchbase/analytics_options.rb +2 -4
  75. data/lib/couchbase/authenticator.rb +14 -0
  76. data/lib/couchbase/binary_collection.rb +9 -9
  77. data/lib/couchbase/binary_collection_options.rb +8 -6
  78. data/lib/couchbase/bucket.rb +18 -18
  79. data/lib/couchbase/cluster.rb +121 -90
  80. data/lib/couchbase/collection.rb +36 -38
  81. data/lib/couchbase/collection_options.rb +31 -17
  82. data/lib/couchbase/common_options.rb +1 -1
  83. data/lib/couchbase/datastructures/couchbase_list.rb +16 -16
  84. data/lib/couchbase/datastructures/couchbase_map.rb +18 -18
  85. data/lib/couchbase/datastructures/couchbase_queue.rb +13 -13
  86. data/lib/couchbase/datastructures/couchbase_set.rb +8 -7
  87. data/lib/couchbase/errors.rb +10 -3
  88. data/lib/couchbase/json_transcoder.rb +2 -2
  89. data/lib/couchbase/management/analytics_index_manager.rb +37 -37
  90. data/lib/couchbase/management/bucket_manager.rb +25 -25
  91. data/lib/couchbase/management/collection_manager.rb +3 -3
  92. data/lib/couchbase/management/query_index_manager.rb +59 -14
  93. data/lib/couchbase/management/search_index_manager.rb +15 -12
  94. data/lib/couchbase/management/user_manager.rb +1 -1
  95. data/lib/couchbase/management/view_index_manager.rb +11 -5
  96. data/lib/couchbase/mutation_state.rb +12 -0
  97. data/lib/couchbase/query_options.rb +23 -9
  98. data/lib/couchbase/scope.rb +61 -1
  99. data/lib/couchbase/search_options.rb +40 -27
  100. data/lib/couchbase/subdoc.rb +31 -28
  101. data/lib/couchbase/version.rb +2 -2
  102. data/lib/couchbase/view_options.rb +0 -1
  103. metadata +22 -9
@@ -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 macro.
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 teh document
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
- case param
263
- when :cas
264
- CAS
265
- when :seq_no, :sequence_number
266
- SEQ_NO
267
- when :value_crc32c, :value_crc
268
- VALUE_CRC32C
269
- else
270
- param
271
- end
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
- unless @param.nil?
275
- @param =
276
- case type
277
- when :counter
278
- @param.to_i
279
- when :array_push_first, :array_push_last, :array_insert
280
- @param.map { |entry| JSON.generate(entry) }.join(",")
281
- else
282
- JSON.generate(@param)
283
- end
284
- end
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
@@ -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.beta.1".freeze)
16
+ VERSION = {} unless defined?(VERSION) # rubocop:disable Style/MutableConstant
17
+ VERSION.update(:sdk => "3.0.0".freeze)
18
18
  end
@@ -16,7 +16,6 @@ require 'json'
16
16
 
17
17
  module Couchbase
18
18
  class Bucket
19
-
20
19
  class ViewOptions
21
20
  # @return [Integer] Timeout in milliseconds
22
21
  attr_accessor :timeout
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.beta.1
4
+ version: 3.0.0
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-08-07 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Modern SDK for Couchbase Server
14
14
  email:
@@ -18,13 +18,17 @@ extensions:
18
18
  - ext/extconf.rb
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - ".rubocop.yml"
22
+ - ".rubocop_todo.yml"
21
23
  - ".yardopts"
24
+ - CONTRIBUTING.md
22
25
  - Gemfile
23
26
  - LICENSE.txt
24
27
  - README.md
25
28
  - Rakefile
26
29
  - couchbase.gemspec
27
30
  - examples/analytics.rb
31
+ - examples/auth.rb
28
32
  - examples/crud.rb
29
33
  - examples/managing_analytics_indexes.rb
30
34
  - examples/managing_buckets.rb
@@ -89,6 +93,11 @@ files:
89
93
  - ext/couchbase/io/mcbp_message.hxx
90
94
  - ext/couchbase/io/mcbp_parser.hxx
91
95
  - ext/couchbase/io/mcbp_session.hxx
96
+ - ext/couchbase/io/retry_action.hxx
97
+ - ext/couchbase/io/retry_context.hxx
98
+ - ext/couchbase/io/retry_orchestrator.hxx
99
+ - ext/couchbase/io/retry_reason.hxx
100
+ - ext/couchbase/io/retry_strategy.hxx
92
101
  - ext/couchbase/io/streams.hxx
93
102
  - ext/couchbase/mutation_token.hxx
94
103
  - ext/couchbase/operations.hxx
@@ -155,12 +164,16 @@ files:
155
164
  - ext/couchbase/operations/view_index_get_all.hxx
156
165
  - ext/couchbase/operations/view_index_upsert.hxx
157
166
  - ext/couchbase/origin.hxx
167
+ - ext/couchbase/platform/backtrace.c
168
+ - ext/couchbase/platform/backtrace.h
158
169
  - ext/couchbase/platform/base64.cc
159
170
  - ext/couchbase/platform/base64.h
160
171
  - ext/couchbase/platform/random.cc
161
172
  - ext/couchbase/platform/random.h
162
173
  - ext/couchbase/platform/string_hex.cc
163
174
  - ext/couchbase/platform/string_hex.h
175
+ - ext/couchbase/platform/terminate_handler.cc
176
+ - ext/couchbase/platform/terminate_handler.h
164
177
  - ext/couchbase/platform/uuid.cc
165
178
  - ext/couchbase/platform/uuid.h
166
179
  - 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/couchbasse/couchbase-ruby-client/tree/3.0.0.beta.1
1436
- changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.0.0.beta.1
1437
- documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.0.0.beta.1/index.html
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:
@@ -1444,14 +1457,14 @@ require_paths:
1444
1457
  - lib
1445
1458
  required_ruby_version: !ruby/object:Gem::Requirement
1446
1459
  requirements:
1447
- - - ">="
1460
+ - - "~>"
1448
1461
  - !ruby/object:Gem::Version
1449
- version: '0'
1462
+ version: '2.5'
1450
1463
  required_rubygems_version: !ruby/object:Gem::Requirement
1451
1464
  requirements:
1452
- - - ">"
1465
+ - - ">="
1453
1466
  - !ruby/object:Gem::Version
1454
- version: 1.3.1
1467
+ version: '0'
1455
1468
  requirements: []
1456
1469
  rubygems_version: 3.1.2
1457
1470
  signing_key: