couchbase 3.0.3-universal-darwin-20 → 3.1.1-universal-darwin-20

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.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/ext/CMakeLists.txt +4 -2
  4. data/ext/build_config.hxx.in +1 -1
  5. data/ext/build_version.hxx.in +2 -2
  6. data/ext/couchbase/bucket.hxx +1 -1
  7. data/ext/couchbase/capabilities.hxx +1 -1
  8. data/ext/couchbase/cluster.hxx +1 -1
  9. data/ext/couchbase/cluster_options.hxx +4 -1
  10. data/ext/couchbase/collections_manifest.hxx +1 -1
  11. data/ext/couchbase/configuration.hxx +1 -1
  12. data/ext/couchbase/couchbase.cxx +743 -927
  13. data/ext/couchbase/diagnostics.hxx +3 -3
  14. data/ext/couchbase/document_id.hxx +1 -1
  15. data/ext/couchbase/error_context/analytics.hxx +1 -1
  16. data/ext/couchbase/error_context/http.hxx +1 -1
  17. data/ext/couchbase/error_context/key_value.hxx +1 -1
  18. data/ext/couchbase/error_context/query.hxx +1 -1
  19. data/ext/couchbase/error_context/search.hxx +1 -1
  20. data/ext/couchbase/error_context/view.hxx +1 -1
  21. data/ext/couchbase/error_map.hxx +1 -1
  22. data/ext/couchbase/errors.hxx +1 -1
  23. data/ext/couchbase/io/dns_client.hxx +1 -1
  24. data/ext/couchbase/io/dns_codec.hxx +1 -1
  25. data/ext/couchbase/io/dns_config.hxx +1 -1
  26. data/ext/couchbase/io/dns_message.hxx +1 -1
  27. data/ext/couchbase/io/http_command.hxx +1 -1
  28. data/ext/couchbase/io/http_context.hxx +1 -1
  29. data/ext/couchbase/io/http_message.hxx +1 -1
  30. data/ext/couchbase/io/http_parser.hxx +1 -1
  31. data/ext/couchbase/io/http_session.hxx +1 -1
  32. data/ext/couchbase/io/http_session_manager.hxx +1 -1
  33. data/ext/couchbase/io/mcbp_command.hxx +1 -1
  34. data/ext/couchbase/io/mcbp_context.hxx +1 -1
  35. data/ext/couchbase/io/mcbp_message.hxx +1 -1
  36. data/ext/couchbase/io/mcbp_parser.hxx +1 -1
  37. data/ext/couchbase/io/mcbp_session.hxx +10 -1
  38. data/ext/couchbase/io/query_cache.hxx +1 -1
  39. data/ext/couchbase/io/retry_action.hxx +1 -1
  40. data/ext/couchbase/io/retry_context.hxx +1 -1
  41. data/ext/couchbase/io/retry_orchestrator.hxx +1 -1
  42. data/ext/couchbase/io/retry_reason.hxx +1 -1
  43. data/ext/couchbase/io/retry_strategy.hxx +1 -1
  44. data/ext/couchbase/io/streams.hxx +1 -1
  45. data/ext/couchbase/mutation_token.hxx +1 -1
  46. data/ext/couchbase/operations.hxx +1 -1
  47. data/ext/couchbase/operations/analytics_dataset_create.hxx +1 -1
  48. data/ext/couchbase/operations/analytics_dataset_drop.hxx +1 -1
  49. data/ext/couchbase/operations/analytics_dataset_get_all.hxx +1 -1
  50. data/ext/couchbase/operations/analytics_dataverse_create.hxx +1 -1
  51. data/ext/couchbase/operations/analytics_dataverse_drop.hxx +1 -1
  52. data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +1 -1
  53. data/ext/couchbase/operations/analytics_index_create.hxx +1 -1
  54. data/ext/couchbase/operations/analytics_index_drop.hxx +1 -1
  55. data/ext/couchbase/operations/analytics_index_get_all.hxx +1 -1
  56. data/ext/couchbase/operations/analytics_link_connect.hxx +1 -1
  57. data/ext/couchbase/operations/analytics_link_disconnect.hxx +1 -1
  58. data/ext/couchbase/operations/bucket_create.hxx +1 -1
  59. data/ext/couchbase/operations/bucket_drop.hxx +1 -1
  60. data/ext/couchbase/operations/bucket_flush.hxx +1 -1
  61. data/ext/couchbase/operations/bucket_get.hxx +1 -1
  62. data/ext/couchbase/operations/bucket_get_all.hxx +1 -1
  63. data/ext/couchbase/operations/bucket_update.hxx +1 -1
  64. data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +1 -1
  65. data/ext/couchbase/operations/collection_create.hxx +13 -9
  66. data/ext/couchbase/operations/collection_drop.hxx +11 -7
  67. data/ext/couchbase/operations/collections_manifest_get.hxx +1 -1
  68. data/ext/couchbase/operations/design_document.hxx +1 -1
  69. data/ext/couchbase/operations/document_analytics.hxx +1 -1
  70. data/ext/couchbase/operations/document_append.hxx +1 -1
  71. data/ext/couchbase/operations/document_decrement.hxx +5 -1
  72. data/ext/couchbase/operations/document_exists.hxx +1 -1
  73. data/ext/couchbase/operations/document_get.hxx +1 -1
  74. data/ext/couchbase/operations/document_get_and_lock.hxx +1 -1
  75. data/ext/couchbase/operations/document_get_and_touch.hxx +1 -1
  76. data/ext/couchbase/operations/document_get_projected.hxx +1 -1
  77. data/ext/couchbase/operations/document_increment.hxx +5 -1
  78. data/ext/couchbase/operations/document_insert.hxx +1 -1
  79. data/ext/couchbase/operations/document_lookup_in.hxx +1 -1
  80. data/ext/couchbase/operations/document_mutate_in.hxx +5 -1
  81. data/ext/couchbase/operations/document_prepend.hxx +1 -1
  82. data/ext/couchbase/operations/document_query.hxx +9 -1
  83. data/ext/couchbase/operations/document_remove.hxx +1 -1
  84. data/ext/couchbase/operations/document_replace.hxx +5 -1
  85. data/ext/couchbase/operations/document_search.hxx +1 -1
  86. data/ext/couchbase/operations/document_touch.hxx +1 -1
  87. data/ext/couchbase/operations/document_unlock.hxx +1 -1
  88. data/ext/couchbase/operations/document_upsert.hxx +5 -1
  89. data/ext/couchbase/operations/document_view.hxx +1 -1
  90. data/ext/couchbase/operations/group_drop.hxx +1 -1
  91. data/ext/couchbase/operations/group_get.hxx +1 -1
  92. data/ext/couchbase/operations/group_get_all.hxx +1 -1
  93. data/ext/couchbase/operations/group_upsert.hxx +1 -1
  94. data/ext/couchbase/operations/http_noop.hxx +1 -1
  95. data/ext/couchbase/operations/mcbp_noop.hxx +1 -1
  96. data/ext/couchbase/operations/query_index_build_deferred.hxx +1 -1
  97. data/ext/couchbase/operations/query_index_create.hxx +1 -1
  98. data/ext/couchbase/operations/query_index_drop.hxx +1 -1
  99. data/ext/couchbase/operations/query_index_get_all.hxx +1 -1
  100. data/ext/couchbase/operations/rbac.hxx +1 -1
  101. data/ext/couchbase/operations/role_get_all.hxx +1 -1
  102. data/ext/couchbase/operations/scope_create.hxx +9 -8
  103. data/ext/couchbase/operations/scope_drop.hxx +9 -6
  104. data/ext/couchbase/operations/scope_get_all.hxx +2 -2
  105. data/ext/couchbase/operations/search_get_stats.hxx +1 -1
  106. data/ext/couchbase/operations/search_index.hxx +1 -1
  107. data/ext/couchbase/operations/search_index_analyze_document.hxx +1 -1
  108. data/ext/couchbase/operations/search_index_control_ingest.hxx +1 -1
  109. data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +1 -1
  110. data/ext/couchbase/operations/search_index_control_query.hxx +1 -1
  111. data/ext/couchbase/operations/search_index_drop.hxx +1 -1
  112. data/ext/couchbase/operations/search_index_get.hxx +1 -1
  113. data/ext/couchbase/operations/search_index_get_all.hxx +1 -1
  114. data/ext/couchbase/operations/search_index_get_documents_count.hxx +1 -1
  115. data/ext/couchbase/operations/search_index_get_stats.hxx +1 -1
  116. data/ext/couchbase/operations/search_index_upsert.hxx +1 -1
  117. data/ext/couchbase/operations/user_drop.hxx +1 -1
  118. data/ext/couchbase/operations/user_get.hxx +1 -1
  119. data/ext/couchbase/operations/user_get_all.hxx +1 -1
  120. data/ext/couchbase/operations/user_upsert.hxx +1 -1
  121. data/ext/couchbase/operations/view_index_drop.hxx +1 -1
  122. data/ext/couchbase/operations/view_index_get.hxx +1 -1
  123. data/ext/couchbase/operations/view_index_get_all.hxx +1 -1
  124. data/ext/couchbase/operations/view_index_upsert.hxx +1 -1
  125. data/ext/couchbase/origin.hxx +1 -1
  126. data/ext/couchbase/protocol/client_opcode.hxx +6 -1
  127. data/ext/couchbase/protocol/client_request.hxx +1 -1
  128. data/ext/couchbase/protocol/client_response.hxx +1 -1
  129. data/ext/couchbase/protocol/cmd_append.hxx +1 -1
  130. data/ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx +1 -1
  131. data/ext/couchbase/protocol/cmd_decrement.hxx +19 -9
  132. data/ext/couchbase/protocol/cmd_exists.hxx +1 -1
  133. data/ext/couchbase/protocol/cmd_get.hxx +1 -1
  134. data/ext/couchbase/protocol/cmd_get_and_lock.hxx +1 -1
  135. data/ext/couchbase/protocol/cmd_get_and_touch.hxx +1 -1
  136. data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +1 -1
  137. data/ext/couchbase/protocol/cmd_get_collection_id.hxx +7 -7
  138. data/ext/couchbase/protocol/cmd_get_collections_manifest.hxx +1 -1
  139. data/ext/couchbase/protocol/cmd_get_error_map.hxx +1 -1
  140. data/ext/couchbase/protocol/cmd_hello.hxx +17 -4
  141. data/ext/couchbase/protocol/cmd_increment.hxx +19 -9
  142. data/ext/couchbase/protocol/cmd_info.hxx +1 -1
  143. data/ext/couchbase/protocol/cmd_insert.hxx +1 -1
  144. data/ext/couchbase/protocol/cmd_lookup_in.hxx +1 -1
  145. data/ext/couchbase/protocol/cmd_mutate_in.hxx +18 -9
  146. data/ext/couchbase/protocol/cmd_noop.hxx +1 -1
  147. data/ext/couchbase/protocol/cmd_prepend.hxx +1 -1
  148. data/ext/couchbase/protocol/cmd_remove.hxx +1 -1
  149. data/ext/couchbase/protocol/cmd_replace.hxx +17 -8
  150. data/ext/couchbase/protocol/cmd_sasl_auth.hxx +1 -1
  151. data/ext/couchbase/protocol/cmd_sasl_list_mechs.hxx +1 -1
  152. data/ext/couchbase/protocol/cmd_sasl_step.hxx +1 -1
  153. data/ext/couchbase/protocol/cmd_select_bucket.hxx +1 -1
  154. data/ext/couchbase/protocol/cmd_touch.hxx +1 -1
  155. data/ext/couchbase/protocol/cmd_unlock.hxx +1 -1
  156. data/ext/couchbase/protocol/cmd_upsert.hxx +17 -8
  157. data/ext/couchbase/protocol/datatype.hxx +1 -1
  158. data/ext/couchbase/protocol/durability_level.hxx +1 -1
  159. data/ext/couchbase/protocol/enhanced_error_info.hxx +1 -1
  160. data/ext/couchbase/protocol/frame_info_id.hxx +2 -2
  161. data/ext/couchbase/protocol/hello_feature.hxx +1 -1
  162. data/ext/couchbase/protocol/magic.hxx +1 -1
  163. data/ext/couchbase/protocol/server_opcode.hxx +1 -1
  164. data/ext/couchbase/protocol/server_request.hxx +1 -1
  165. data/ext/couchbase/protocol/status.hxx +1 -1
  166. data/ext/couchbase/service_type.hxx +1 -1
  167. data/ext/couchbase/timeout_defaults.hxx +1 -1
  168. data/ext/couchbase/utils/byteswap.hxx +1 -1
  169. data/ext/couchbase/utils/connection_string.hxx +28 -1
  170. data/ext/couchbase/version.hxx +2 -2
  171. data/ext/extconf.rb +1 -1
  172. data/ext/test/test_helper.hxx +1 -1
  173. data/ext/test/test_helper_native.hxx +1 -1
  174. data/ext/test/test_helper_ruby.hxx +1 -1
  175. data/ext/test/test_native_binary_operations.cxx +1 -1
  176. data/ext/test/test_native_diagnostics.cxx +1 -1
  177. data/ext/test/test_native_trivial_crud.cxx +1 -1
  178. data/ext/test/test_ruby_trivial_crud.cxx +1 -1
  179. data/ext/test/test_ruby_trivial_query.cxx +1 -1
  180. data/lib/active_support/cache/couchbase_store.rb +2 -1
  181. data/lib/couchbase.rb +1 -1
  182. data/lib/couchbase/analytics_options.rb +1 -1
  183. data/lib/couchbase/authenticator.rb +1 -1
  184. data/lib/couchbase/binary_collection.rb +1 -1
  185. data/lib/couchbase/binary_collection_options.rb +1 -1
  186. data/lib/couchbase/bucket.rb +1 -1
  187. data/lib/couchbase/cluster.rb +2 -2
  188. data/lib/couchbase/collection.rb +1 -1
  189. data/lib/couchbase/collection_options.rb +25 -19
  190. data/lib/couchbase/configuration.rb +1 -1
  191. data/lib/couchbase/datastructures.rb +1 -1
  192. data/lib/couchbase/datastructures/couchbase_list.rb +1 -1
  193. data/lib/couchbase/datastructures/couchbase_map.rb +1 -1
  194. data/lib/couchbase/datastructures/couchbase_queue.rb +1 -1
  195. data/lib/couchbase/datastructures/couchbase_set.rb +1 -1
  196. data/lib/couchbase/diagnostics.rb +1 -1
  197. data/lib/couchbase/errors.rb +1 -1
  198. data/lib/couchbase/json_transcoder.rb +1 -1
  199. data/lib/couchbase/libcouchbase.bundle +0 -0
  200. data/lib/couchbase/logger.rb +1 -1
  201. data/lib/couchbase/management.rb +1 -1
  202. data/lib/couchbase/management/analytics_index_manager.rb +1 -1
  203. data/lib/couchbase/management/bucket_manager.rb +1 -1
  204. data/lib/couchbase/management/collection_manager.rb +8 -1
  205. data/lib/couchbase/management/query_index_manager.rb +1 -1
  206. data/lib/couchbase/management/search_index_manager.rb +1 -1
  207. data/lib/couchbase/management/user_manager.rb +1 -1
  208. data/lib/couchbase/management/view_index_manager.rb +1 -1
  209. data/lib/couchbase/mutation_state.rb +1 -1
  210. data/lib/couchbase/options.rb +49 -4
  211. data/lib/couchbase/query_options.rb +1 -1
  212. data/lib/couchbase/railtie.rb +1 -1
  213. data/lib/couchbase/scope.rb +7 -6
  214. data/lib/couchbase/search_options.rb +1 -1
  215. data/lib/couchbase/subdoc.rb +2 -2
  216. data/lib/couchbase/utils.rb +1 -1
  217. data/lib/couchbase/utils/time.rb +1 -1
  218. data/lib/couchbase/version.rb +9 -9
  219. data/lib/couchbase/view_options.rb +1 -1
  220. data/lib/rails/generators/couchbase/config/config_generator.rb +1 -1
  221. metadata +5 -5
data/lib/couchbase.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -152,7 +152,7 @@ module Couchbase
152
152
  metrics.processed_objects = resp[:meta][:metrics][:processed_objects]
153
153
  end
154
154
  end
155
- res[:warnings] = resp[:warnings].map { |warn| QueryWarning.new(warn[:code], warn[:message]) } if resp[:warnings]
155
+ res[:warnings] = resp[:warnings].map { |warn| AnalyticsWarning.new(warn[:code], warn[:message]) } if resp[:warnings]
156
156
  end
157
157
  res.instance_variable_set("@rows", resp[:rows])
158
158
  end
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -151,15 +151,6 @@ module Couchbase
151
151
  !encoded[index].nil? && encoded[index].exists
152
152
  end
153
153
 
154
- # @see MutateInOptions#create_as_deleted
155
- #
156
- # @return [Boolean] true if the document is a tombstone (created in deleted state)
157
- def deleted?
158
- @deleted
159
- end
160
-
161
- attr_accessor :deleted
162
-
163
154
  # @return [Array<SubDocumentField>] holds the encoded subdocument responses
164
155
  attr_accessor :encoded
165
156
 
@@ -172,6 +163,18 @@ module Couchbase
172
163
  # @return [JsonTranscoder] The default transcoder which should be used
173
164
  attr_accessor :transcoder
174
165
 
166
+ # @api private
167
+ #
168
+ # @see MutateInOptions#create_as_deleted
169
+ #
170
+ # @return [Boolean] true if the document is a tombstone (created in deleted state)
171
+ def deleted?
172
+ @deleted
173
+ end
174
+
175
+ # @api private
176
+ attr_accessor :deleted
177
+
175
178
  private
176
179
 
177
180
  def get_field_at_index(index)
@@ -199,15 +202,6 @@ module Couchbase
199
202
  end
200
203
  end
201
204
 
202
- # @see MutateInOptions#create_as_deleted
203
- #
204
- # @return [Boolean] true if the document is a tombstone (created in deleted state)
205
- def deleted?
206
- @deleted
207
- end
208
-
209
- attr_accessor :deleted
210
-
211
205
  # @yieldparam [MutateInResult] self
212
206
  def initialize
213
207
  super
@@ -235,6 +229,18 @@ module Couchbase
235
229
  # @return [JsonTranscoder] The default transcoder which should be used
236
230
  attr_accessor :transcoder
237
231
 
232
+ # @api private
233
+ #
234
+ # @see MutateInOptions#create_as_deleted
235
+ #
236
+ # @return [Boolean] true if the document is a tombstone (created in deleted state)
237
+ def deleted?
238
+ @deleted
239
+ end
240
+
241
+ # @api private
242
+ attr_accessor :deleted
243
+
238
244
  private
239
245
 
240
246
  def get_field_at_index(index)
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
Binary file
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -12,11 +12,15 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ require "rubygems/deprecate"
16
+
15
17
  require "couchbase/errors"
16
18
 
17
19
  module Couchbase
18
20
  module Management
19
21
  class CollectionManager
22
+ extend Gem::Deprecate
23
+
20
24
  alias inspect to_s
21
25
 
22
26
  # @param [Couchbase::Backend] backend
@@ -51,6 +55,8 @@ module Couchbase
51
55
  # @param [String] scope_name name of the scope
52
56
  # @param [GetScopeOptions] options
53
57
  #
58
+ # @deprecated Use {#get_all_scopes} with filter by name
59
+ #
54
60
  # @return [ScopeSpec]
55
61
  #
56
62
  # @raise [Error::ScopeNotFound]
@@ -58,6 +64,7 @@ module Couchbase
58
64
  get_all_scopes(GetAllScopesOptions.new { |o| o.timeout = options.timeout })
59
65
  .find { |scope| scope.name == scope_name } or raise Error::ScopeNotFound, "unable to find scope #{scope_name}"
60
66
  end
67
+ deprecate :get_scope, :get_all_scopes, 2021, 6
61
68
 
62
69
  # Creates a new scope
63
70
  #
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2021 Couchbase, Inc.
1
+ # Copyright 2020-2021 Couchbase, Inc.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
@@ -507,10 +507,13 @@ module Couchbase
507
507
  attr_accessor :expiry # @return [Integer, #in_seconds, nil]
508
508
  attr_accessor :transcoder # @return [JsonTranscoder, #encode(Object)]
509
509
  attr_accessor :durability_level # @return [Symbol]
510
+ attr_accessor :preserve_expiry # @return [Boolean]
510
511
 
511
512
  # Creates an instance of options for {Collection#upsert}
512
513
  #
513
514
  # @param [Integer, #in_seconds, Time, nil] expiry expiration time to associate with the document
515
+ # @param [Boolean] preserve_expiry if true and the document exists, the server will preserve current expiration
516
+ # for the document, otherwise will use {expiry} from the operation.
514
517
  # @param [JsonTranscoder, #encode(Object)] transcoder used for encoding
515
518
  # @param [Symbol] durability_level level of durability
516
519
  # +:none+::
@@ -533,6 +536,7 @@ module Couchbase
533
536
  #
534
537
  # @yieldparam [Upsert]
535
538
  def initialize(expiry: nil,
539
+ preserve_expiry: false,
536
540
  transcoder: JsonTranscoder.new,
537
541
  durability_level: :none,
538
542
  timeout: nil,
@@ -541,6 +545,7 @@ module Couchbase
541
545
  parent_span: nil)
542
546
  super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
543
547
  @expiry = Utils::Time.extract_expiry_time(expiry)
548
+ @preserve_expiry = preserve_expiry
544
549
  @transcoder = transcoder
545
550
  @durability_level = durability_level
546
551
  yield self if block_given?
@@ -550,6 +555,7 @@ module Couchbase
550
555
  {
551
556
  timeout: @timeout.respond_to?(:in_milliseconds) ? @timeout.public_send(:in_milliseconds) : @timeout,
552
557
  expiry: @expiry,
558
+ preserve_expiry: @preserve_expiry,
553
559
  durability_level: @durability_level,
554
560
  }
555
561
  end
@@ -560,10 +566,13 @@ module Couchbase
560
566
  attr_accessor :expiry # @return [Integer, #in_seconds, nil]
561
567
  attr_accessor :transcoder # @return [JsonTranscoder, #encode(Object)]
562
568
  attr_accessor :durability_level # @return [Symbol]
569
+ attr_accessor :preserve_expiry # @return [Boolean]
563
570
 
564
571
  # Creates an instance of options for {Collection#upsert}
565
572
  #
566
573
  # @param [Integer, #in_seconds, Time, nil] expiry expiration time to associate with the document
574
+ # @param [Boolean] preserve_expiry if true and the document exists, the server will preserve current expiration
575
+ # for the document, otherwise will use {expiry} from the operation.
567
576
  # @param [JsonTranscoder, #encode(Object)] transcoder used for encoding
568
577
  # @param [Symbol] durability_level level of durability
569
578
  # +:none+::
@@ -586,6 +595,7 @@ module Couchbase
586
595
  #
587
596
  # @yieldparam [Upsert]
588
597
  def initialize(expiry: nil,
598
+ preserve_expiry: false,
589
599
  transcoder: JsonTranscoder.new,
590
600
  durability_level: :none,
591
601
  timeout: nil,
@@ -594,6 +604,7 @@ module Couchbase
594
604
  parent_span: nil)
595
605
  super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
596
606
  @expiry = Utils::Time.extract_expiry_time(expiry)
607
+ @preserve_expiry = preserve_expiry
597
608
  @transcoder = transcoder
598
609
  @durability_level = durability_level
599
610
  yield self if block_given?
@@ -603,6 +614,7 @@ module Couchbase
603
614
  {
604
615
  timeout: @timeout.respond_to?(:in_milliseconds) ? @timeout.public_send(:in_milliseconds) : @timeout,
605
616
  expiry: @expiry,
617
+ preserve_expiry: @preserve_expiry,
606
618
  durability_level: @durability_level,
607
619
  }
608
620
  end
@@ -614,10 +626,13 @@ module Couchbase
614
626
  attr_accessor :transcoder # @return [JsonTranscoder, #encode(Object)]
615
627
  attr_accessor :cas # @return [Integer, nil]
616
628
  attr_accessor :durability_level # @return [Symbol]
629
+ attr_accessor :preserve_expiry # @return [Boolean]
617
630
 
618
631
  # Creates an instance of options for {Collection#replace}
619
632
  #
620
633
  # @param [Integer, #in_seconds, nil] expiry expiration time to associate with the document
634
+ # @param [Boolean] preserve_expiry if true and the document exists, the server will preserve current expiration
635
+ # for the document, otherwise will use {expiry} from the operation.
621
636
  # @param [JsonTranscoder, #encode(Object)] transcoder used for encoding
622
637
  # @param [Integer, nil] cas a CAS value that will be taken into account on the server side for optimistic concurrency
623
638
  # @param [Symbol] durability_level level of durability
@@ -641,6 +656,7 @@ module Couchbase
641
656
  #
642
657
  # @yieldparam [Replace]
643
658
  def initialize(expiry: nil,
659
+ preserve_expiry: false,
644
660
  transcoder: JsonTranscoder.new,
645
661
  cas: nil,
646
662
  durability_level: :none,
@@ -650,6 +666,7 @@ module Couchbase
650
666
  parent_span: nil)
651
667
  super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
652
668
  @expiry = Utils::Time.extract_expiry_time(expiry)
669
+ @preserve_expiry = preserve_expiry
653
670
  @transcoder = transcoder
654
671
  @cas = cas
655
672
  @durability_level = durability_level
@@ -660,6 +677,7 @@ module Couchbase
660
677
  {
661
678
  timeout: @timeout.respond_to?(:in_milliseconds) ? @timeout.public_send(:in_milliseconds) : @timeout,
662
679
  expiry: @expiry,
680
+ preserve_expiry: @preserve_expiry,
663
681
  durability_level: @durability_level,
664
682
  cas: @cas,
665
683
  }
@@ -671,14 +689,15 @@ module Couchbase
671
689
  attr_accessor :expiry # @return [Integer, #in_seconds, nil]
672
690
  attr_accessor :store_semantics # @return [Symbol]
673
691
  attr_accessor :cas # @return [Integer, nil]
674
- attr_accessor :access_deleted # @return [Boolean]
675
- attr_accessor :create_as_deleted # @return [Boolean]
676
692
  attr_accessor :durability_level # @return [Symbol]
677
693
  attr_accessor :transcoder # @return [JsonTranscoder, #encode(Object)]
694
+ attr_accessor :preserve_expiry # @return [Boolean]
678
695
 
679
696
  # Creates an instance of options for {Collection#mutate_in}
680
697
  #
681
698
  # @param [Integer, #in_seconds, Time, nil] expiry expiration time to associate with the document
699
+ # @param [Boolean] preserve_expiry if true and the document exists, the server will preserve current expiration
700
+ # for the document, otherwise will use {expiry} from the operation.
682
701
  # @param [Symbol] store_semantics describes how the outer document store semantics on subdoc should act
683
702
  # +:replace+:: replace the document, fail if it does not exist. This is the default
684
703
  # +:upsert+:: replace the document or create if it does not exist
@@ -708,6 +727,7 @@ module Couchbase
708
727
  #
709
728
  # @yieldparam [MutateIn]
710
729
  def initialize(expiry: nil,
730
+ preserve_expiry: false,
711
731
  store_semantics: :replace,
712
732
  cas: nil,
713
733
  access_deleted: false,
@@ -720,6 +740,7 @@ module Couchbase
720
740
  parent_span: nil)
721
741
  super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
722
742
  @expiry = Utils::Time.extract_expiry_time(expiry)
743
+ @preserve_expiry = preserve_expiry
723
744
  @store_semantics = store_semantics
724
745
  @cas = cas
725
746
  @access_deleted = access_deleted
@@ -734,6 +755,7 @@ module Couchbase
734
755
  {
735
756
  timeout: @timeout.respond_to?(:in_milliseconds) ? @timeout.public_send(:in_milliseconds) : @timeout,
736
757
  expiry: @expiry,
758
+ preserve_expiry: @preserve_expiry,
737
759
  durability_level: @durability_level,
738
760
  cas: @cas,
739
761
  store_semantics: @store_semantics,
@@ -741,11 +763,18 @@ module Couchbase
741
763
  create_as_deleted: @create_as_deleted,
742
764
  }
743
765
  end
766
+
767
+ # @api private
768
+ # @return [Boolean]
769
+ attr_accessor :access_deleted
770
+
771
+ # @api private
772
+ # @return [Boolean]
773
+ attr_accessor :create_as_deleted
744
774
  end
745
775
 
746
776
  # Options for {Collection#lookup_in}
747
777
  class LookupIn < Base
748
- attr_accessor :access_deleted # @return [Boolean]
749
778
  attr_accessor :transcoder # @return [JsonTranscoder, #decode(String)]
750
779
 
751
780
  # Creates an instance of options for {Collection#lookup_in}
@@ -778,6 +807,10 @@ module Couchbase
778
807
  access_deleted: @access_deleted,
779
808
  }
780
809
  end
810
+
811
+ # @api private
812
+ # @return [Boolean]
813
+ attr_accessor :access_deleted
781
814
  end
782
815
 
783
816
  # Options for {BinaryCollection#append}
@@ -853,12 +886,15 @@ module Couchbase
853
886
  attr_accessor :initial # @return [Integer]
854
887
  attr_accessor :expiry # @return [Integer, #in_seconds]
855
888
  attr_accessor :durability_level # @return [Symbol]
889
+ attr_accessor :preserve_expiry # @return [Boolean]
856
890
 
857
891
  # Creates an instance of options for {BinaryCollection#increment}
858
892
  #
859
893
  # @param [Integer] delta the delta for the operation
860
894
  # @param [Integer] initial if present, holds the initial value
861
895
  # @param [Integer, #in_seconds, Time, nil] expiry if set, holds the expiration for the operation
896
+ # @param [Boolean] preserve_expiry if true and the document exists, the server will preserve current expiration
897
+ # for the document, otherwise will use {expiry} from the operation.
862
898
  # @param [Symbol] durability_level level of durability
863
899
  # +:none+::
864
900
  # no enhanced durability required for the mutation
@@ -882,6 +918,7 @@ module Couchbase
882
918
  def initialize(delta: 1,
883
919
  initial: nil,
884
920
  expiry: nil,
921
+ preserve_expiry: false,
885
922
  durability_level: :none,
886
923
  timeout: nil,
887
924
  retry_strategy: nil,
@@ -893,6 +930,7 @@ module Couchbase
893
930
  @delta = delta
894
931
  @initial = initial
895
932
  @expiry = Utils::Time.extract_expiry_time(expiry)
933
+ @preserve_expiry = preserve_expiry
896
934
  @durability_level = durability_level
897
935
  yield self if block_given?
898
936
  end
@@ -911,6 +949,7 @@ module Couchbase
911
949
  delta: @delta,
912
950
  initial_value: @initial,
913
951
  expiry: @expiry,
952
+ preserve_expiry: @preserve_expiry,
914
953
  durability_level: @durability_level,
915
954
  }
916
955
  end
@@ -922,12 +961,15 @@ module Couchbase
922
961
  attr_accessor :initial # @return [Integer]
923
962
  attr_accessor :expiry # @return [Integer, #in_seconds]
924
963
  attr_accessor :durability_level # @return [Symbol]
964
+ attr_accessor :preserve_expiry # @return [Boolean]
925
965
 
926
966
  # Creates an instance of options for {BinaryCollection#decrement}
927
967
  #
928
968
  # @param [Integer] delta the delta for the operation
929
969
  # @param [Integer] initial if present, holds the initial value
930
970
  # @param [Integer, #in_seconds, Time, nil] expiry if set, holds the expiration for the operation
971
+ # @param [Boolean] preserve_expiry if true and the document exists, the server will preserve current expiration
972
+ # for the document, otherwise will use {expiry} from the operation.
931
973
  # @param [Symbol] durability_level level of durability
932
974
  # +:none+::
933
975
  # no enhanced durability required for the mutation
@@ -951,6 +993,7 @@ module Couchbase
951
993
  def initialize(delta: 1,
952
994
  initial: nil,
953
995
  expiry: nil,
996
+ preserve_expiry: false,
954
997
  durability_level: :none,
955
998
  timeout: nil,
956
999
  retry_strategy: nil,
@@ -962,6 +1005,7 @@ module Couchbase
962
1005
  @delta = delta
963
1006
  @initial = initial
964
1007
  @expiry = Utils::Time.extract_expiry_time(expiry)
1008
+ @preserve_expiry = preserve_expiry
965
1009
  @durability_level = durability_level
966
1010
  yield self if block_given?
967
1011
  end
@@ -980,6 +1024,7 @@ module Couchbase
980
1024
  delta: @delta,
981
1025
  initial_value: @initial,
982
1026
  expiry: @expiry,
1027
+ preserve_expiry: @preserve_expiry,
983
1028
  durability_level: @durability_level,
984
1029
  }
985
1030
  end