couchbase 3.8.1 → 3.9.0

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 (475) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/ext/CMakeLists.txt +16 -1
  4. data/ext/cache/cpm/{CPM_0.42.0.cmake → CPM_0.43.1.cmake} +18 -2
  5. data/ext/cache/extconf_include.rb +6 -6
  6. data/ext/cache/mozilla-ca-bundle.crt +214 -155
  7. data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
  8. data/ext/couchbase/CMakeLists.txt +130 -21
  9. data/ext/couchbase/cmake/APKBUILD.in +25 -4
  10. data/ext/couchbase/cmake/Bundler.cmake +143 -34
  11. data/ext/couchbase/cmake/CPM.cmake +126 -12
  12. data/ext/couchbase/cmake/Cache.cmake +7 -1
  13. data/ext/couchbase/cmake/CompilerOptions.cmake +1 -1
  14. data/ext/couchbase/cmake/CompilerWarnings.cmake +17 -6
  15. data/ext/couchbase/cmake/GrpcProtobuf.cmake +481 -0
  16. data/ext/couchbase/cmake/OpenSSL.cmake +10 -3
  17. data/ext/couchbase/cmake/Packaging.cmake +519 -65
  18. data/ext/couchbase/cmake/Protostellar.cmake +250 -0
  19. data/ext/couchbase/cmake/Sanitizers.cmake +61 -50
  20. data/ext/couchbase/cmake/StaticAnalyzers.cmake +16 -5
  21. data/ext/couchbase/cmake/TestFramework.cmake +283 -0
  22. data/ext/couchbase/cmake/TestFrameworkAddTests.cmake +51 -0
  23. data/ext/couchbase/cmake/Testing.cmake +27 -9
  24. data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +141 -8
  25. data/ext/couchbase/cmake/VersionInfo.cmake +50 -0
  26. data/ext/couchbase/cmake/build_config.hxx.in +2 -1
  27. data/ext/couchbase/cmake/couchbase-cxx-client.spec.in +101 -23
  28. data/ext/couchbase/cmake/couchbase_cxx_client_static-config.cmake.in +7 -0
  29. data/ext/couchbase/cmake/couchbase_cxx_client_static.pc.in +2 -0
  30. data/ext/couchbase/cmake/gRPC_Generate.cmake +58 -0
  31. data/ext/couchbase/cmake/protobuf_Generate.cmake +69 -0
  32. data/ext/couchbase/cmake/require-git-checkout.cmake +25 -0
  33. data/ext/couchbase/cmake/tarball_glob.txt +49 -0
  34. data/ext/couchbase/core/agent_group.cxx +0 -8
  35. data/ext/couchbase/core/agent_group.hxx +0 -4
  36. data/ext/couchbase/core/analytics_stream.cxx +314 -0
  37. data/ext/couchbase/core/analytics_stream.hxx +129 -0
  38. data/ext/couchbase/core/analytics_stream_component.cxx +245 -0
  39. data/ext/couchbase/core/analytics_stream_component.hxx +67 -0
  40. data/ext/couchbase/core/app_telemetry_meter.cxx +25 -3
  41. data/ext/couchbase/core/app_telemetry_meter.hxx +77 -0
  42. data/ext/couchbase/core/app_telemetry_reporter.cxx +7 -6
  43. data/ext/couchbase/core/bucket.cxx +381 -87
  44. data/ext/couchbase/core/bucket.hxx +105 -25
  45. data/ext/couchbase/core/bucket_unit_test_api.hxx +57 -0
  46. data/ext/couchbase/core/capella.hxx +91 -0
  47. data/ext/couchbase/core/cluster.cxx +1554 -398
  48. data/ext/couchbase/core/cluster.hxx +39 -8
  49. data/ext/couchbase/core/cluster_agent.cxx +0 -8
  50. data/ext/couchbase/core/cluster_agent.hxx +0 -4
  51. data/ext/couchbase/core/cluster_options.hxx +26 -3
  52. data/ext/couchbase/core/collections_component.cxx +39 -15
  53. data/ext/couchbase/core/config_profiles.cxx +1 -1
  54. data/ext/couchbase/core/crud_component.cxx +2 -2
  55. data/ext/couchbase/core/crud_options.hxx +34 -0
  56. data/ext/couchbase/core/crypto/cbcrypto.cc +18 -13
  57. data/ext/couchbase/core/document_id_redaction.hxx +81 -0
  58. data/ext/couchbase/core/error_context/base_error_context.hxx +7 -6
  59. data/ext/couchbase/core/error_context/key_value.cxx +25 -2
  60. data/ext/couchbase/core/error_context/key_value.hxx +60 -33
  61. data/ext/couchbase/core/error_context/key_value_error_context.hxx +16 -15
  62. data/ext/couchbase/core/error_context/search.hxx +5 -0
  63. data/ext/couchbase/core/error_context/search_json.hxx +3 -0
  64. data/ext/couchbase/core/error_context/subdocument_error_context.hxx +19 -18
  65. data/ext/couchbase/core/error_context/view.hxx +5 -0
  66. data/ext/couchbase/core/free_form_http_request.cxx +237 -4
  67. data/ext/couchbase/core/free_form_http_request.hxx +41 -8
  68. data/ext/couchbase/core/http_component.cxx +300 -284
  69. data/ext/couchbase/core/http_component.hxx +0 -4
  70. data/ext/couchbase/core/impl/analytics.cxx +38 -5
  71. data/ext/couchbase/core/impl/analytics.hxx +34 -0
  72. data/ext/couchbase/core/impl/bootstrap_error.hxx +0 -3
  73. data/ext/couchbase/core/impl/collection.cxx +215 -202
  74. data/ext/couchbase/core/impl/collection_manager.cxx +1 -1
  75. data/ext/couchbase/core/impl/dns_srv_tracker.cxx +45 -18
  76. data/ext/couchbase/core/impl/error.cxx +22 -2
  77. data/ext/couchbase/core/impl/internal_analytics_stream_result.hxx +111 -0
  78. data/ext/couchbase/core/impl/internal_query_stream_result.hxx +110 -0
  79. data/ext/couchbase/core/impl/invoke_with_node_id.hxx +15 -7
  80. data/ext/couchbase/core/impl/key_value_error_category.cxx +6 -0
  81. data/ext/couchbase/core/impl/lookup_in_replica.cxx +10 -10
  82. data/ext/couchbase/core/impl/lookup_in_replica.hxx +4 -4
  83. data/ext/couchbase/core/impl/node_id.cxx +49 -13
  84. data/ext/couchbase/core/impl/observability_recorder.cxx +12 -2
  85. data/ext/couchbase/core/impl/observe_poll.cxx +63 -23
  86. data/ext/couchbase/core/impl/public_analytics_stream_result.cxx +372 -0
  87. data/ext/couchbase/core/impl/public_bucket.cxx +48 -2
  88. data/ext/couchbase/core/impl/public_cluster.cxx +325 -25
  89. data/ext/couchbase/core/impl/public_query_stream_result.cxx +380 -0
  90. data/ext/couchbase/core/impl/public_transaction_get_multi_replicas_from_preferred_server_group_result.cxx +42 -0
  91. data/ext/couchbase/core/impl/public_transaction_get_multi_result.cxx +42 -0
  92. data/ext/couchbase/core/impl/query.cxx +76 -7
  93. data/ext/couchbase/core/impl/query.hxx +36 -0
  94. data/ext/couchbase/core/impl/query_index_manager.cxx +54 -1
  95. data/ext/couchbase/core/impl/replica_utils.cxx +101 -0
  96. data/ext/couchbase/core/impl/replica_utils.hxx +64 -0
  97. data/ext/couchbase/core/impl/resolve_node_id.hxx +125 -0
  98. data/ext/couchbase/core/impl/scope.cxx +70 -0
  99. data/ext/couchbase/core/impl/search.cxx +31 -1
  100. data/ext/couchbase/core/impl/transactions.cxx +130 -0
  101. data/ext/couchbase/core/impl/wait_until_ready.cxx +439 -0
  102. data/ext/couchbase/core/impl/wait_until_ready.hxx +110 -0
  103. data/ext/couchbase/core/impl/with_bucket_config_or_timeout.hxx +180 -0
  104. data/ext/couchbase/core/impl/with_cancellation.hxx +11 -3
  105. data/ext/couchbase/core/io/configuration_belongs_to_session.hxx +66 -0
  106. data/ext/couchbase/core/io/dns_client.cxx +122 -45
  107. data/ext/couchbase/core/io/dns_codec.hxx +21 -21
  108. data/ext/couchbase/core/io/dns_config.cxx +21 -6
  109. data/ext/couchbase/core/io/http_command.hxx +149 -121
  110. data/ext/couchbase/core/io/http_error.hxx +107 -0
  111. data/ext/couchbase/core/io/http_parser.cxx +4 -0
  112. data/ext/couchbase/core/io/http_session.cxx +606 -154
  113. data/ext/couchbase/core/io/http_session.hxx +147 -30
  114. data/ext/couchbase/core/io/http_session_manager.hxx +329 -382
  115. data/ext/couchbase/core/io/http_streaming_parser.cxx +4 -0
  116. data/ext/couchbase/core/io/http_streaming_response.cxx +328 -43
  117. data/ext/couchbase/core/io/http_streaming_response.hxx +37 -3
  118. data/ext/couchbase/core/io/mcbp_buffer_pool.hxx +122 -0
  119. data/ext/couchbase/core/io/mcbp_command.hxx +150 -51
  120. data/ext/couchbase/core/io/mcbp_command_id.hxx +45 -0
  121. data/ext/couchbase/core/io/mcbp_message.cxx +9 -1
  122. data/ext/couchbase/core/io/mcbp_message.hxx +19 -0
  123. data/ext/couchbase/core/io/mcbp_output_queue.hxx +150 -0
  124. data/ext/couchbase/core/io/mcbp_parser.cxx +24 -7
  125. data/ext/couchbase/core/io/mcbp_session.cxx +316 -317
  126. data/ext/couchbase/core/io/mcbp_session.hxx +27 -18
  127. data/ext/couchbase/core/io/opaque_ring_table.hxx +145 -0
  128. data/ext/couchbase/core/io/retry_orchestrator.hxx +6 -5
  129. data/ext/couchbase/core/io/stream_deadline.hxx +50 -0
  130. data/ext/couchbase/core/io/streams.cxx +275 -14
  131. data/ext/couchbase/core/io/streams.hxx +53 -0
  132. data/ext/couchbase/core/logger/logger.cxx +36 -0
  133. data/ext/couchbase/core/logger/logger.hxx +46 -6
  134. data/ext/couchbase/core/logger/redaction.hxx +503 -0
  135. data/ext/couchbase/core/management/eventing_status.hxx +10 -0
  136. data/ext/couchbase/core/management/eventing_status_json.hxx +4 -0
  137. data/ext/couchbase/core/mcbp/big_endian.cxx +1 -1
  138. data/ext/couchbase/core/mcbp/codec.cxx +27 -18
  139. data/ext/couchbase/core/mcbp/operation_queue.cxx +2 -2
  140. data/ext/couchbase/core/mcbp/packet.hxx +2 -2
  141. data/ext/couchbase/core/mcbp/queue_request.cxx +23 -6
  142. data/ext/couchbase/core/mcbp/queue_request.hxx +21 -0
  143. data/ext/couchbase/core/meta/features.hxx +13 -0
  144. data/ext/couchbase/core/meta/version.cxx +6 -3
  145. data/ext/couchbase/core/metrics/logging_meter.cxx +5 -10
  146. data/ext/couchbase/core/metrics/meter_wrapper.cxx +63 -33
  147. data/ext/couchbase/core/metrics/meter_wrapper.hxx +55 -3
  148. data/ext/couchbase/core/operations/analytics_response_parsing.cxx +177 -0
  149. data/ext/couchbase/core/operations/analytics_response_parsing.hxx +55 -0
  150. data/ext/couchbase/core/operations/document_analytics.cxx +48 -130
  151. data/ext/couchbase/core/operations/document_analytics.hxx +14 -2
  152. data/ext/couchbase/core/operations/document_get_all_replicas.hxx +15 -7
  153. data/ext/couchbase/core/operations/document_get_any_replica.hxx +19 -8
  154. data/ext/couchbase/core/operations/document_get_projected.cxx +1 -1
  155. data/ext/couchbase/core/{impl/get_replica.cxx → operations/document_get_replica.cxx} +21 -3
  156. data/ext/couchbase/core/{impl/get_replica.hxx → operations/document_get_replica.hxx} +31 -4
  157. data/ext/couchbase/core/operations/document_lookup_in.cxx +10 -10
  158. data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +228 -198
  159. data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +215 -217
  160. data/ext/couchbase/core/operations/document_query.cxx +108 -221
  161. data/ext/couchbase/core/operations/document_query.hxx +18 -4
  162. data/ext/couchbase/core/operations/document_search.cxx +52 -8
  163. data/ext/couchbase/core/operations/document_search.hxx +3 -0
  164. data/ext/couchbase/core/operations/document_view.cxx +3 -3
  165. data/ext/couchbase/core/operations/management/analytics_dataset_create.cxx +15 -8
  166. data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +4 -0
  167. data/ext/couchbase/core/operations/management/analytics_dataset_drop.cxx +11 -6
  168. data/ext/couchbase/core/operations/management/analytics_dataset_get_all.cxx +3 -2
  169. data/ext/couchbase/core/operations/management/analytics_dataverse_create.cxx +10 -5
  170. data/ext/couchbase/core/operations/management/analytics_dataverse_drop.cxx +10 -5
  171. data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.cxx +2 -1
  172. data/ext/couchbase/core/operations/management/analytics_index_create.cxx +33 -8
  173. data/ext/couchbase/core/operations/management/analytics_index_drop.cxx +12 -7
  174. data/ext/couchbase/core/operations/management/analytics_index_get_all.cxx +3 -2
  175. data/ext/couchbase/core/operations/management/analytics_link_connect.cxx +11 -6
  176. data/ext/couchbase/core/operations/management/analytics_link_create.cxx +3 -3
  177. data/ext/couchbase/core/operations/management/analytics_link_disconnect.cxx +10 -4
  178. data/ext/couchbase/core/operations/management/analytics_link_drop.cxx +6 -4
  179. data/ext/couchbase/core/operations/management/analytics_link_get_all.cxx +4 -3
  180. data/ext/couchbase/core/operations/management/analytics_link_replace.cxx +3 -3
  181. data/ext/couchbase/core/operations/management/analytics_link_utils.hxx +1 -1
  182. data/ext/couchbase/core/operations/management/bucket_create.cxx +37 -38
  183. data/ext/couchbase/core/operations/management/bucket_update.cxx +26 -28
  184. data/ext/couchbase/core/operations/management/change_password.cxx +2 -0
  185. data/ext/couchbase/core/operations/management/collection_drop.cxx +5 -1
  186. data/ext/couchbase/core/operations/management/error_utils.cxx +59 -5
  187. data/ext/couchbase/core/operations/management/error_utils.hxx +29 -1
  188. data/ext/couchbase/core/operations/management/eventing_deploy_function.cxx +9 -3
  189. data/ext/couchbase/core/operations/management/eventing_drop_function.cxx +8 -3
  190. data/ext/couchbase/core/operations/management/eventing_get_all_functions.cxx +4 -2
  191. data/ext/couchbase/core/operations/management/eventing_get_function.cxx +5 -3
  192. data/ext/couchbase/core/operations/management/eventing_get_status.cxx +4 -2
  193. data/ext/couchbase/core/operations/management/eventing_pause_function.cxx +9 -3
  194. data/ext/couchbase/core/operations/management/eventing_resume_function.cxx +9 -3
  195. data/ext/couchbase/core/operations/management/eventing_undeploy_function.cxx +9 -3
  196. data/ext/couchbase/core/operations/management/eventing_upsert_function.cxx +9 -3
  197. data/ext/couchbase/core/operations/management/group_drop.cxx +3 -1
  198. data/ext/couchbase/core/operations/management/group_get.cxx +3 -1
  199. data/ext/couchbase/core/operations/management/group_upsert.cxx +11 -8
  200. data/ext/couchbase/core/operations/management/query_index_build.cxx +5 -2
  201. data/ext/couchbase/core/operations/management/query_index_create.cxx +9 -3
  202. data/ext/couchbase/core/operations/management/query_index_drop.cxx +11 -4
  203. data/ext/couchbase/core/operations/management/query_index_get_all.cxx +1 -1
  204. data/ext/couchbase/core/operations/management/query_index_get_all_deferred.cxx +1 -1
  205. data/ext/couchbase/core/operations/management/scope_drop.cxx +5 -1
  206. data/ext/couchbase/core/operations/management/scope_get_all.cxx +6 -1
  207. data/ext/couchbase/core/operations/management/search_get_stats.cxx +10 -0
  208. data/ext/couchbase/core/operations/management/search_index_analyze_document.cxx +3 -2
  209. data/ext/couchbase/core/operations/management/search_index_control_ingest.cxx +4 -3
  210. data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.cxx +4 -3
  211. data/ext/couchbase/core/operations/management/search_index_control_query.cxx +4 -3
  212. data/ext/couchbase/core/operations/management/search_index_drop.cxx +2 -2
  213. data/ext/couchbase/core/operations/management/search_index_get.cxx +2 -2
  214. data/ext/couchbase/core/operations/management/search_index_get_documents_count.cxx +3 -2
  215. data/ext/couchbase/core/operations/management/search_index_get_stats.cxx +3 -1
  216. data/ext/couchbase/core/operations/management/search_index_upsert.cxx +2 -2
  217. data/ext/couchbase/core/operations/management/user_drop.cxx +3 -1
  218. data/ext/couchbase/core/operations/management/user_get.cxx +3 -1
  219. data/ext/couchbase/core/operations/management/user_upsert.cxx +12 -9
  220. data/ext/couchbase/core/operations/management/view_index_drop.cxx +1 -1
  221. data/ext/couchbase/core/operations/management/view_index_get.cxx +1 -1
  222. data/ext/couchbase/core/operations/management/view_index_upsert.cxx +1 -1
  223. data/ext/couchbase/core/operations/operation_traits.hxx +18 -0
  224. data/ext/couchbase/core/operations/query_response_parsing.cxx +211 -0
  225. data/ext/couchbase/core/operations/query_response_parsing.hxx +60 -0
  226. data/ext/couchbase/core/operations_fwd.hxx +3 -3
  227. data/ext/couchbase/core/origin.cxx +54 -26
  228. data/ext/couchbase/core/origin.hxx +12 -0
  229. data/ext/couchbase/core/orphan_reporter.cxx +2 -1
  230. data/ext/couchbase/core/platform/random.cc +7 -7
  231. data/ext/couchbase/core/protocol/client_request.cxx +2 -2
  232. data/ext/couchbase/core/protocol/client_request.hxx +38 -21
  233. data/ext/couchbase/core/protocol/client_response.cxx +11 -3
  234. data/ext/couchbase/core/protocol/client_response.hxx +27 -6
  235. data/ext/couchbase/core/protocol/cmd_append.cxx +2 -2
  236. data/ext/couchbase/core/protocol/cmd_cluster_map_change_notification.cxx +2 -2
  237. data/ext/couchbase/core/protocol/cmd_decrement.cxx +6 -6
  238. data/ext/couchbase/core/protocol/cmd_get.cxx +1 -1
  239. data/ext/couchbase/core/protocol/cmd_get_and_lock.cxx +2 -2
  240. data/ext/couchbase/core/protocol/cmd_get_and_touch.cxx +2 -2
  241. data/ext/couchbase/core/protocol/cmd_get_cluster_config.cxx +6 -4
  242. data/ext/couchbase/core/protocol/cmd_get_collection_id.cxx +2 -2
  243. data/ext/couchbase/core/protocol/cmd_get_error_map.cxx +1 -1
  244. data/ext/couchbase/core/protocol/cmd_get_meta.cxx +4 -4
  245. data/ext/couchbase/core/protocol/cmd_get_replica.cxx +1 -1
  246. data/ext/couchbase/core/protocol/cmd_hello.cxx +1 -1
  247. data/ext/couchbase/core/protocol/cmd_increment.cxx +6 -6
  248. data/ext/couchbase/core/protocol/cmd_insert.cxx +4 -4
  249. data/ext/couchbase/core/protocol/cmd_lookup_in.cxx +4 -3
  250. data/ext/couchbase/core/protocol/cmd_lookup_in_replica.cxx +4 -3
  251. data/ext/couchbase/core/protocol/cmd_mutate_in.cxx +10 -9
  252. data/ext/couchbase/core/protocol/cmd_mutate_in.hxx +10 -10
  253. data/ext/couchbase/core/protocol/cmd_observe_seqno.cxx +7 -7
  254. data/ext/couchbase/core/protocol/cmd_prepend.cxx +2 -2
  255. data/ext/couchbase/core/protocol/cmd_remove.cxx +2 -2
  256. data/ext/couchbase/core/protocol/cmd_replace.cxx +4 -4
  257. data/ext/couchbase/core/protocol/cmd_touch.cxx +1 -1
  258. data/ext/couchbase/core/protocol/cmd_upsert.cxx +4 -4
  259. data/ext/couchbase/core/protocol/datatype.hxx +118 -1
  260. data/ext/couchbase/core/protocol/frame_info_utils.cxx +1 -1
  261. data/ext/couchbase/core/protocol/magic.hxx +4 -0
  262. data/ext/couchbase/core/protocol/magic_fmt.hxx +3 -0
  263. data/ext/couchbase/core/protocol/server_request.hxx +3 -1
  264. data/ext/couchbase/core/protocol/status.cxx +1 -1
  265. data/ext/couchbase/core/protostellar/analytics_converter.hxx +171 -0
  266. data/ext/couchbase/core/protostellar/bucket_admin_converter.hxx +301 -0
  267. data/ext/couchbase/core/protostellar/collection_admin_converter.hxx +92 -0
  268. data/ext/couchbase/core/protostellar/component.cxx +2445 -0
  269. data/ext/couchbase/core/protostellar/component.hxx +391 -0
  270. data/ext/couchbase/core/{columnar/bootstrap_notification_subscriber.hxx → protostellar/compression_settings.hxx} +11 -10
  271. data/ext/couchbase/core/protostellar/credentials.cxx +233 -0
  272. data/ext/couchbase/core/protostellar/credentials.hxx +88 -0
  273. data/ext/couchbase/core/protostellar/dispatcher.cxx +57 -0
  274. data/ext/couchbase/core/protostellar/dispatcher.hxx +482 -0
  275. data/ext/couchbase/core/protostellar/error_utils.cxx +293 -0
  276. data/ext/couchbase/core/protostellar/error_utils.hxx +97 -0
  277. data/ext/couchbase/core/protostellar/json_payload.hxx +49 -0
  278. data/ext/couchbase/core/protostellar/kv_converter.cxx +70 -0
  279. data/ext/couchbase/core/protostellar/kv_converter.hxx +600 -0
  280. data/ext/couchbase/core/protostellar/query_converter.hxx +265 -0
  281. data/ext/couchbase/core/protostellar/query_index_admin_converter.hxx +291 -0
  282. data/ext/couchbase/core/protostellar/query_proto.hxx +73 -0
  283. data/ext/couchbase/core/protostellar/search_converter.hxx +244 -0
  284. data/ext/couchbase/core/protostellar/search_index_admin_converter.hxx +156 -0
  285. data/ext/couchbase/core/protostellar/view_converter.hxx +158 -0
  286. data/ext/couchbase/core/query_stream.cxx +447 -0
  287. data/ext/couchbase/core/query_stream.hxx +141 -0
  288. data/ext/couchbase/core/query_stream_component.cxx +243 -0
  289. data/ext/couchbase/core/query_stream_component.hxx +68 -0
  290. data/ext/couchbase/core/range_scan_load_balancer.cxx +15 -8
  291. data/ext/couchbase/core/range_scan_orchestrator.cxx +15 -3
  292. data/ext/couchbase/core/response_handler.hxx +41 -4
  293. data/ext/couchbase/core/row_streamer.cxx +332 -46
  294. data/ext/couchbase/core/row_streamer.hxx +31 -1
  295. data/ext/couchbase/core/row_streamer_options.hxx +55 -0
  296. data/ext/couchbase/core/sasl/client.h +3 -0
  297. data/ext/couchbase/core/search_scoring.hxx +66 -0
  298. data/ext/couchbase/core/stream_error_details.hxx +69 -0
  299. data/ext/couchbase/core/timeout_defaults.hxx +0 -1
  300. data/ext/couchbase/core/topology/capabilities.hxx +6 -0
  301. data/ext/couchbase/core/topology/capabilities_fmt.hxx +3 -0
  302. data/ext/couchbase/core/topology/configuration.cxx +21 -6
  303. data/ext/couchbase/core/topology/configuration.hxx +29 -8
  304. data/ext/couchbase/core/topology/configuration_json.hxx +3 -0
  305. data/ext/couchbase/core/topology/error_map_json.hxx +3 -1
  306. data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +70 -4
  307. data/ext/couchbase/core/tracing/threshold_logging_tracer.hxx +10 -0
  308. data/ext/couchbase/core/transactions/active_transaction_record.cxx +0 -34
  309. data/ext/couchbase/core/transactions/attempt_context_impl.cxx +362 -241
  310. data/ext/couchbase/core/transactions/attempt_context_impl.hxx +24 -3
  311. data/ext/couchbase/core/transactions/error_list.hxx +2 -2
  312. data/ext/couchbase/core/transactions/get_multi_fetch.hxx +160 -0
  313. data/ext/couchbase/core/transactions/get_multi_orchestrator.cxx +326 -125
  314. data/ext/couchbase/core/transactions/get_multi_transaction_id.hxx +62 -0
  315. data/ext/couchbase/core/transactions/internal/atr_entry.hxx +22 -2
  316. data/ext/couchbase/core/transactions/internal/transaction_context.hxx +2 -2
  317. data/ext/couchbase/core/transactions/internal/transactions_cleanup.hxx +23 -1
  318. data/ext/couchbase/core/transactions/internal/utils.hxx +50 -14
  319. data/ext/couchbase/core/transactions/staged_mutation.cxx +23 -18
  320. data/ext/couchbase/core/transactions/staged_mutation.hxx +15 -4
  321. data/ext/couchbase/core/transactions/transaction_context.cxx +55 -40
  322. data/ext/couchbase/core/transactions/transaction_get_result.hxx +16 -0
  323. data/ext/couchbase/core/transactions/transactions.cxx +3 -55
  324. data/ext/couchbase/core/transactions/transactions_cleanup.cxx +194 -66
  325. data/ext/couchbase/core/transactions/transactions_config.cxx +0 -11
  326. data/ext/couchbase/core/transactions/utils.cxx +10 -0
  327. data/ext/couchbase/core/transactions/waitable_op_list.hxx +15 -4
  328. data/ext/couchbase/core/transactions.hxx +9 -9
  329. data/ext/couchbase/core/utils/byteswap.hxx +166 -9
  330. data/ext/couchbase/core/utils/connection_string.cxx +50 -85
  331. data/ext/couchbase/core/utils/connection_string.hxx +15 -0
  332. data/ext/couchbase/core/{columnar/backoff_calculator.hxx → utils/deadline.hxx} +13 -13
  333. data/ext/couchbase/core/utils/duration_parser.cxx +1 -1
  334. data/ext/couchbase/core/utils/json_streaming_lexer.cxx +48 -5
  335. data/ext/couchbase/core/utils/json_streaming_lexer.hxx +4 -1
  336. data/ext/couchbase/core/utils/movable_function.hxx +301 -52
  337. data/ext/couchbase/core/utils/name_codec.hxx +154 -11
  338. data/ext/couchbase/core/{columnar/retry_info.hxx → utils/process_id.hxx} +18 -13
  339. data/ext/couchbase/core/utils/url_codec.cxx +12 -51
  340. data/ext/couchbase/core/websocket_codec.cxx +3 -29
  341. data/ext/couchbase/couchbase/analytics_options.hxx +21 -10
  342. data/ext/couchbase/couchbase/analytics_row.hxx +105 -0
  343. data/ext/couchbase/couchbase/analytics_stream_result.hxx +266 -0
  344. data/ext/couchbase/couchbase/boolean_query.hxx +3 -3
  345. data/ext/couchbase/couchbase/bucket.hxx +57 -0
  346. data/ext/couchbase/couchbase/cluster.hxx +216 -5
  347. data/ext/couchbase/{core/columnar/security_options.hxx → couchbase/cluster_state.hxx} +18 -14
  348. data/ext/couchbase/couchbase/codec/lenient_json_transcoder.hxx +69 -0
  349. data/ext/couchbase/couchbase/collection.hxx +234 -14
  350. data/ext/couchbase/couchbase/common_durability_options.hxx +18 -3
  351. data/ext/couchbase/couchbase/conjunction_query.hxx +1 -1
  352. data/ext/couchbase/couchbase/create_dataset_analytics_options.hxx +6 -1
  353. data/ext/couchbase/couchbase/date_range_query.hxx +2 -2
  354. data/ext/couchbase/couchbase/decrement_options.hxx +1 -1
  355. data/ext/couchbase/couchbase/disjunction_query.hxx +1 -1
  356. data/ext/couchbase/couchbase/error.hxx +32 -0
  357. data/ext/couchbase/couchbase/error_codes.hxx +32 -0
  358. data/ext/couchbase/couchbase/geo_bounding_box_query.hxx +1 -1
  359. data/ext/couchbase/couchbase/geo_distance_query.hxx +1 -1
  360. data/ext/couchbase/couchbase/geo_polygon_query.hxx +1 -1
  361. data/ext/couchbase/couchbase/get_replica_options.hxx +68 -0
  362. data/ext/couchbase/couchbase/get_replica_result.hxx +5 -3
  363. data/ext/couchbase/couchbase/get_replica_strategy.hxx +161 -0
  364. data/ext/couchbase/couchbase/get_result.hxx +1 -0
  365. data/ext/couchbase/couchbase/increment_options.hxx +1 -1
  366. data/ext/couchbase/couchbase/insert_options.hxx +1 -1
  367. data/ext/couchbase/couchbase/match_phrase_query.hxx +1 -1
  368. data/ext/couchbase/couchbase/match_query.hxx +1 -1
  369. data/ext/couchbase/couchbase/mutate_in_options.hxx +3 -3
  370. data/ext/couchbase/couchbase/network_options.hxx +1 -1
  371. data/ext/couchbase/couchbase/node_id.hxx +42 -14
  372. data/ext/couchbase/couchbase/node_id_for_options.hxx +7 -1
  373. data/ext/couchbase/couchbase/node_ids_options.hxx +8 -2
  374. data/ext/couchbase/couchbase/numeric_range_query.hxx +1 -1
  375. data/ext/couchbase/couchbase/phrase_query.hxx +1 -1
  376. data/ext/couchbase/couchbase/prefix_query.hxx +1 -1
  377. data/ext/couchbase/couchbase/query_options.hxx +23 -12
  378. data/ext/couchbase/couchbase/query_row.hxx +111 -0
  379. data/ext/couchbase/couchbase/query_stream_result.hxx +302 -0
  380. data/ext/couchbase/couchbase/query_string_query.hxx +3 -3
  381. data/ext/couchbase/couchbase/regexp_query.hxx +1 -1
  382. data/ext/couchbase/couchbase/replace_options.hxx +3 -3
  383. data/ext/couchbase/couchbase/result.hxx +14 -3
  384. data/ext/couchbase/couchbase/scan_result_item.hxx +1 -0
  385. data/ext/couchbase/couchbase/scope.hxx +85 -2
  386. data/ext/couchbase/couchbase/search_options.hxx +58 -8
  387. data/ext/couchbase/couchbase/search_scoring.hxx +94 -0
  388. data/ext/couchbase/couchbase/search_scoring_none.hxx +51 -0
  389. data/ext/couchbase/couchbase/search_scoring_reciprocal_rank_fusion.hxx +88 -0
  390. data/ext/couchbase/couchbase/search_scoring_relative_score_fusion.hxx +70 -0
  391. data/ext/couchbase/couchbase/term_range_query.hxx +1 -1
  392. data/ext/couchbase/couchbase/tracing/request_span.hxx +46 -0
  393. data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_result.hxx +23 -21
  394. data/ext/couchbase/couchbase/transactions/transaction_get_multi_result.hxx +24 -19
  395. data/ext/couchbase/couchbase/transactions/transaction_get_result.hxx +17 -3
  396. data/ext/couchbase/couchbase/transactions/transactions_config.hxx +4 -2
  397. data/ext/couchbase/couchbase/transactions.hxx +27 -18
  398. data/ext/couchbase/couchbase/upsert_options.hxx +3 -3
  399. data/ext/couchbase/couchbase/vector_query.hxx +1 -1
  400. data/ext/couchbase/couchbase/wait_until_ready_options.hxx +111 -0
  401. data/ext/couchbase/couchbase/wildcard_query.hxx +1 -1
  402. data/ext/extconf.rb +15 -10
  403. data/ext/rcb_analytics.cxx +82 -102
  404. data/ext/rcb_backend.cxx +42 -36
  405. data/ext/rcb_backend.hxx +2 -0
  406. data/ext/rcb_buckets.cxx +47 -59
  407. data/ext/rcb_collections.cxx +42 -52
  408. data/ext/rcb_crud.cxx +345 -224
  409. data/ext/rcb_diagnostics.cxx +117 -27
  410. data/ext/rcb_exceptions.cxx +152 -99
  411. data/ext/rcb_exceptions.hxx +25 -0
  412. data/ext/rcb_extras.cxx +18 -19
  413. data/ext/rcb_hdr_histogram.cxx +19 -4
  414. data/ext/rcb_logger.cxx +202 -27
  415. data/ext/rcb_logger.hxx +12 -0
  416. data/ext/rcb_multi.cxx +40 -40
  417. data/ext/rcb_observability.cxx +7 -5
  418. data/ext/rcb_query.cxx +99 -142
  419. data/ext/rcb_range_scan.cxx +41 -35
  420. data/ext/rcb_search.cxx +98 -99
  421. data/ext/rcb_users.cxx +36 -56
  422. data/ext/rcb_utils.cxx +100 -37
  423. data/ext/rcb_utils.hxx +287 -33
  424. data/ext/rcb_version.cxx +1 -1
  425. data/ext/rcb_views.cxx +55 -51
  426. data/lib/active_support/cache/couchbase_store.rb +77 -12
  427. data/lib/couchbase/bucket.rb +20 -0
  428. data/lib/couchbase/cluster.rb +33 -14
  429. data/lib/couchbase/collection.rb +36 -1
  430. data/lib/couchbase/errors.rb +18 -0
  431. data/lib/couchbase/fork_hooks.rb +16 -7
  432. data/lib/couchbase/get_replica_strategy.rb +89 -0
  433. data/lib/couchbase/logger.rb +1 -1
  434. data/lib/couchbase/management/analytics_index_manager.rb +15 -15
  435. data/lib/couchbase/management/bucket_manager.rb +6 -6
  436. data/lib/couchbase/management/collection_manager.rb +6 -6
  437. data/lib/couchbase/management/query_index_manager.rb +7 -7
  438. data/lib/couchbase/management/search_index_manager.rb +13 -13
  439. data/lib/couchbase/management/user_manager.rb +10 -10
  440. data/lib/couchbase/management/view_index_manager.rb +5 -5
  441. data/lib/couchbase/options.rb +181 -44
  442. data/lib/couchbase/protostellar/bucket.rb +4 -0
  443. data/lib/couchbase/protostellar/cluster.rb +4 -0
  444. data/lib/couchbase/protostellar/collection.rb +4 -0
  445. data/lib/couchbase/protostellar/error_handling.rb +2 -1
  446. data/lib/couchbase/protostellar/request.rb +1 -0
  447. data/lib/couchbase/protostellar/request_generator/kv.rb +16 -2
  448. data/lib/couchbase/protostellar/request_generator/search.rb +17 -1
  449. data/lib/couchbase/protostellar/retry/orchestrator.rb +3 -2
  450. data/lib/couchbase/protostellar/retry/strategies/fail_fast.rb +33 -0
  451. data/lib/couchbase/protostellar/retry/strategies.rb +1 -0
  452. data/lib/couchbase/search_options.rb +95 -6
  453. data/lib/couchbase/version.rb +1 -1
  454. metadata +92 -33
  455. data/ext/0001-fix-build-for-mingw-w64-ucrt-x86_64-toolchain.patch +0 -40
  456. data/ext/couchbase/core/columnar/agent.hxx +0 -71
  457. data/ext/couchbase/core/columnar/agent_config.hxx +0 -59
  458. data/ext/couchbase/core/columnar/background_bootstrap_listener.hxx +0 -42
  459. data/ext/couchbase/core/columnar/backoff_calculator.cxx +0 -62
  460. data/ext/couchbase/core/columnar/columnar_agent.cxx +0 -147
  461. data/ext/couchbase/core/columnar/columnar_agent_config.cxx +0 -48
  462. data/ext/couchbase/core/columnar/columnar_error.cxx +0 -51
  463. data/ext/couchbase/core/columnar/database_management_options.hxx +0 -56
  464. data/ext/couchbase/core/columnar/error.hxx +0 -51
  465. data/ext/couchbase/core/columnar/error_codes.cxx +0 -107
  466. data/ext/couchbase/core/columnar/error_codes.hxx +0 -75
  467. data/ext/couchbase/core/columnar/management_component.cxx +0 -300
  468. data/ext/couchbase/core/columnar/management_component.hxx +0 -56
  469. data/ext/couchbase/core/columnar/query_component.cxx +0 -523
  470. data/ext/couchbase/core/columnar/query_component.hxx +0 -57
  471. data/ext/couchbase/core/columnar/query_options.hxx +0 -59
  472. data/ext/couchbase/core/columnar/query_result.cxx +0 -130
  473. data/ext/couchbase/core/columnar/query_result.hxx +0 -78
  474. data/ext/couchbase/core/io/config_tracker.cxx +0 -687
  475. data/ext/couchbase/core/io/config_tracker.hxx +0 -123
@@ -24,12 +24,14 @@ module Couchbase
24
24
  # Base class for most of the options
25
25
  class Base
26
26
  attr_accessor :timeout # @return [Integer, #in_milliseconds, nil]
27
- attr_accessor :retry_strategy # @return [Proc, nil]
27
+ attr_accessor :retry_strategy # @return [Symbol, nil]
28
28
  attr_accessor :client_context # @return [Hash, nil]
29
29
  attr_accessor :parent_span # @return [Span, nil]
30
30
 
31
31
  # @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
32
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
32
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+, honoured by key/value operations
33
+ # other than {Collection#get_any_replica}, {Collection#get_all_replicas} and range scans; the cluster's
34
+ # default when +nil+
33
35
  # @param [Hash, nil] client_context the client context data, if set
34
36
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
35
37
  #
@@ -42,7 +44,8 @@ module Couchbase
42
44
  @retry_strategy = retry_strategy
43
45
  @client_context = client_context
44
46
  @parent_span = parent_span
45
- yield self if block_given?
47
+ # A subclass yields at the end of its own initialize, once its defaults are set.
48
+ yield self if block_given? && instance_of?(Base)
46
49
  end
47
50
 
48
51
  # @api private
@@ -65,7 +68,7 @@ module Couchbase
65
68
  # @param [JsonTranscoder, #decode(String, Integer)] transcoder used for decoding
66
69
  #
67
70
  # @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
68
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
71
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
69
72
  # @param [Hash, nil] client_context the client context data, if set
70
73
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
71
74
  #
@@ -114,6 +117,7 @@ module Couchbase
114
117
  def to_backend
115
118
  options = {
116
119
  timeout: Utils::Time.extract_duration(@timeout),
120
+ retry_strategy: @retry_strategy,
117
121
  }
118
122
  options.update(with_expiry: true) if @with_expiry
119
123
  unless @projections.nil? || @projections.empty?
@@ -138,7 +142,7 @@ module Couchbase
138
142
  # @param [JsonTranscoder, #decode(String, Integer)] transcoder used for decoding
139
143
  #
140
144
  # @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
141
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
145
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
142
146
  # @param [Hash, nil] client_context the client context data, if set
143
147
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
144
148
  #
@@ -157,6 +161,7 @@ module Couchbase
157
161
  def to_backend
158
162
  {
159
163
  timeout: Utils::Time.extract_duration(@timeout),
164
+ retry_strategy: @retry_strategy,
160
165
  }
161
166
  end
162
167
 
@@ -173,7 +178,7 @@ module Couchbase
173
178
  # @param [JsonTranscoder, #decode(String, Integer)] transcoder used for decoding
174
179
  #
175
180
  # @param [Integer, #in_milliseconds, nil] timeout
176
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
181
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
177
182
  # @param [Hash, nil] client_context the client context data, if set
178
183
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
179
184
  #
@@ -192,6 +197,7 @@ module Couchbase
192
197
  def to_backend
193
198
  {
194
199
  timeout: Utils::Time.extract_duration(@timeout),
200
+ retry_strategy: @retry_strategy,
195
201
  }
196
202
  end
197
203
 
@@ -208,7 +214,7 @@ module Couchbase
208
214
  # @param [JsonTranscoder, #decode(String, Integer)] transcoder used for decoding
209
215
  #
210
216
  # @param [Integer, #in_milliseconds, nil] timeout
211
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
217
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
212
218
  # @param [Hash, nil] client_context the client context data, if set
213
219
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
214
220
  #
@@ -227,6 +233,7 @@ module Couchbase
227
233
  def to_backend
228
234
  {
229
235
  timeout: Utils::Time.extract_duration(@timeout),
236
+ retry_strategy: @retry_strategy,
230
237
  }
231
238
  end
232
239
 
@@ -247,7 +254,7 @@ module Couchbase
247
254
  # +:selected_server_group+:: restrict to nodes in {Cluster#preferred_server_group}
248
255
  #
249
256
  # @param [Integer, #in_milliseconds, nil] timeout
250
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
257
+ # @param [Symbol, nil] retry_strategy ignored by this operation
251
258
  # @param [Hash, nil] client_context the client context data, if set
252
259
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
253
260
  #
@@ -289,7 +296,7 @@ module Couchbase
289
296
  # +:selected_server_group+:: restrict to nodes in {Cluster#preferred_server_group}
290
297
  #
291
298
  # @param [Integer, #in_milliseconds, nil] timeout
292
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
299
+ # @param [Symbol, nil] retry_strategy ignored by this operation
293
300
  # @param [Hash, nil] client_context the client context data, if set
294
301
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
295
302
  #
@@ -318,12 +325,50 @@ module Couchbase
318
325
  DEFAULT = GetAnyReplica.new.freeze
319
326
  end
320
327
 
328
+ # Options for {Collection#get_replica}
329
+ #
330
+ # @since 3.9.0
331
+ class GetReplica < Base
332
+ attr_accessor :transcoder # @return [JsonTranscoder, #decode(String, Integer)]
333
+
334
+ # Creates an instance of options for {Collection#get_replica}
335
+ #
336
+ # @param [JsonTranscoder, #decode(String, Integer)] transcoder used for decoding
337
+ #
338
+ # @param [Integer, #in_milliseconds, nil] timeout
339
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
340
+ # @param [Hash, nil] client_context the client context data, if set
341
+ # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
342
+ #
343
+ # @yieldparam [GetReplica] self
344
+ def initialize(transcoder: JsonTranscoder.new,
345
+ timeout: nil,
346
+ retry_strategy: nil,
347
+ client_context: nil,
348
+ parent_span: nil)
349
+ super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span, &nil)
350
+ @transcoder = transcoder
351
+ yield self if block_given?
352
+ end
353
+
354
+ # @api private
355
+ def to_backend
356
+ {
357
+ timeout: Utils::Time.extract_duration(@timeout),
358
+ retry_strategy: @retry_strategy,
359
+ }
360
+ end
361
+
362
+ # @api private
363
+ DEFAULT = GetReplica.new.freeze
364
+ end
365
+
321
366
  # Options for {Collection#exists}
322
367
  class Exists < Base
323
368
  # Creates an instance of options for {Collection#exists}
324
369
  #
325
370
  # @param [Integer, #in_milliseconds, nil] timeout
326
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
371
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
327
372
  # @param [Hash, nil] client_context the client context data, if set
328
373
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
329
374
  #
@@ -340,6 +385,7 @@ module Couchbase
340
385
  def to_backend
341
386
  {
342
387
  timeout: Utils::Time.extract_duration(@timeout),
388
+ retry_strategy: @retry_strategy,
343
389
  }
344
390
  end
345
391
 
@@ -352,7 +398,7 @@ module Couchbase
352
398
  # Creates an instance of options for {Collection#touch}
353
399
  #
354
400
  # @param [Integer, #in_milliseconds, nil] timeout
355
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
401
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
356
402
  # @param [Hash, nil] client_context the client context data, if set
357
403
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
358
404
  #
@@ -369,6 +415,7 @@ module Couchbase
369
415
  def to_backend
370
416
  {
371
417
  timeout: Utils::Time.extract_duration(@timeout),
418
+ retry_strategy: @retry_strategy,
372
419
  }
373
420
  end
374
421
 
@@ -381,7 +428,7 @@ module Couchbase
381
428
  # Creates an instance of options for {Collection#unlock}
382
429
  #
383
430
  # @param [Integer, #in_milliseconds, nil] timeout
384
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
431
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
385
432
  # @param [Hash, nil] client_context the client context data, if set
386
433
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
387
434
  #
@@ -398,6 +445,7 @@ module Couchbase
398
445
  def to_backend
399
446
  {
400
447
  timeout: Utils::Time.extract_duration(@timeout),
448
+ retry_strategy: @retry_strategy,
401
449
  }
402
450
  end
403
451
 
@@ -440,7 +488,7 @@ module Couchbase
440
488
  # +:four+:: wait for persistence to four nodes (active and replicas).
441
489
  #
442
490
  # @param [Integer, #in_milliseconds, nil] timeout
443
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
491
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
444
492
  # @param [Hash, nil] client_context the client context data, if set
445
493
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
446
494
  #
@@ -469,6 +517,7 @@ module Couchbase
469
517
  def to_backend
470
518
  {
471
519
  timeout: Utils::Time.extract_duration(@timeout),
520
+ retry_strategy: @retry_strategy,
472
521
  durability_level: @durability_level,
473
522
  persist_to: @persist_to,
474
523
  replicate_to: @replicate_to,
@@ -513,7 +562,7 @@ module Couchbase
513
562
  # +:four+:: wait for persistence to four nodes (active and replicas).
514
563
  #
515
564
  # @param [Integer, #in_milliseconds, nil] timeout
516
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
565
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
517
566
  # @param [Hash, nil] client_context the client context data, if set
518
567
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
519
568
  #
@@ -540,6 +589,7 @@ module Couchbase
540
589
  def to_backend
541
590
  {
542
591
  timeout: Utils::Time.extract_duration(@timeout),
592
+ retry_strategy: @retry_strategy,
543
593
  durability_level: @durability_level,
544
594
  persist_to: @persist_to,
545
595
  replicate_to: @replicate_to,
@@ -587,7 +637,7 @@ module Couchbase
587
637
  # +:four+:: wait for persistence to four nodes (active and replicas).
588
638
  #
589
639
  # @param [Integer, #in_milliseconds, nil] timeout
590
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
640
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
591
641
  # @param [Hash, nil] client_context the client context data, if set
592
642
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
593
643
  #
@@ -618,6 +668,7 @@ module Couchbase
618
668
  def to_backend
619
669
  {
620
670
  timeout: Utils::Time.extract_duration(@timeout),
671
+ retry_strategy: @retry_strategy,
621
672
  expiry: Utils::Time.extract_expiry_time(@expiry),
622
673
  durability_level: @durability_level,
623
674
  persist_to: @persist_to,
@@ -669,7 +720,7 @@ module Couchbase
669
720
  # +:four+:: wait for persistence to four nodes (active and replicas).
670
721
  #
671
722
  # @param [Integer, #in_milliseconds, nil] timeout
672
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
723
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
673
724
  # @param [Hash, nil] client_context the client context data, if set
674
725
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
675
726
  #
@@ -701,6 +752,7 @@ module Couchbase
701
752
  def to_backend
702
753
  {
703
754
  timeout: Utils::Time.extract_duration(@timeout),
755
+ retry_strategy: @retry_strategy,
704
756
  expiry: Utils::Time.extract_expiry_time(@expiry),
705
757
  preserve_expiry: @preserve_expiry,
706
758
  durability_level: @durability_level,
@@ -753,7 +805,7 @@ module Couchbase
753
805
  # +:four+:: wait for persistence to four nodes (active and replicas).
754
806
  #
755
807
  # @param [Integer, #in_milliseconds, nil] timeout
756
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
808
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
757
809
  # @param [Hash, nil] client_context the client context data, if set
758
810
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
759
811
  #
@@ -785,6 +837,7 @@ module Couchbase
785
837
  def to_backend
786
838
  {
787
839
  timeout: Utils::Time.extract_duration(@timeout),
840
+ retry_strategy: @retry_strategy,
788
841
  expiry: Utils::Time.extract_expiry_time(@expiry),
789
842
  preserve_expiry: @preserve_expiry,
790
843
  durability_level: @durability_level,
@@ -839,7 +892,7 @@ module Couchbase
839
892
  # +:four+:: wait for persistence to four nodes (active and replicas).
840
893
  #
841
894
  # @param [Integer, #in_milliseconds, nil] timeout
842
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
895
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
843
896
  # @param [Hash, nil] client_context the client context data, if set
844
897
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
845
898
  #
@@ -873,6 +926,7 @@ module Couchbase
873
926
  def to_backend
874
927
  {
875
928
  timeout: Utils::Time.extract_duration(@timeout),
929
+ retry_strategy: @retry_strategy,
876
930
  expiry: Utils::Time.extract_expiry_time(@expiry),
877
931
  preserve_expiry: @preserve_expiry,
878
932
  durability_level: @durability_level,
@@ -935,7 +989,7 @@ module Couchbase
935
989
  # @param [JsonTranscoder, #encode(Object)] transcoder used for encoding
936
990
  #
937
991
  # @param [Integer, #in_milliseconds, nil] timeout
938
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
992
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
939
993
  # @param [Hash, nil] client_context the client context data, if set
940
994
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
941
995
  #
@@ -976,6 +1030,7 @@ module Couchbase
976
1030
  def to_backend
977
1031
  {
978
1032
  timeout: Utils::Time.extract_duration(@timeout),
1033
+ retry_strategy: @retry_strategy,
979
1034
  expiry: Utils::Time.extract_expiry_time(@expiry),
980
1035
  preserve_expiry: @preserve_expiry,
981
1036
  durability_level: @durability_level,
@@ -1010,7 +1065,7 @@ module Couchbase
1010
1065
  # @param [JsonTranscoder, #decode(String)] transcoder used for encoding
1011
1066
  #
1012
1067
  # @param [Integer, #in_milliseconds, nil] timeout
1013
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1068
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
1014
1069
  # @param [Hash, nil] client_context the client context data, if set
1015
1070
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1016
1071
  #
@@ -1031,6 +1086,7 @@ module Couchbase
1031
1086
  def to_backend
1032
1087
  {
1033
1088
  timeout: Utils::Time.extract_duration(@timeout),
1089
+ retry_strategy: @retry_strategy,
1034
1090
  access_deleted: @access_deleted,
1035
1091
  }
1036
1092
  end
@@ -1056,7 +1112,7 @@ module Couchbase
1056
1112
  # +:selected_server_group+:: restrict to nodes in {Cluster#preferred_server_group}
1057
1113
  #
1058
1114
  # @param [Integer, #in_milliseconds, nil] timeout
1059
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1115
+ # @param [Symbol, nil] retry_strategy ignored by this operation
1060
1116
  # @param [Hash, nil] client_context the client context data, if set
1061
1117
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1062
1118
  #
@@ -1102,7 +1158,7 @@ module Couchbase
1102
1158
  # +:selected_server_group+:: restrict to nodes in {Cluster#preferred_server_group}
1103
1159
  #
1104
1160
  # @param [Integer, #in_milliseconds, nil] timeout
1105
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1161
+ # @param [Symbol, nil] retry_strategy ignored by this operation
1106
1162
  # @param [Hash, nil] client_context the client context data, if set
1107
1163
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1108
1164
  #
@@ -1153,7 +1209,7 @@ module Couchbase
1153
1209
  # defaults to 1
1154
1210
  #
1155
1211
  # @param [Integer, #in_milliseconds, nil] timeout
1156
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1212
+ # @param [Symbol, nil] retry_strategy ignored by this operation
1157
1213
  # @param [Hash, nil] client_context the client context data, if set
1158
1214
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1159
1215
  #
@@ -1239,7 +1295,7 @@ module Couchbase
1239
1295
  # +:four+:: wait for persistence to four nodes (active and replicas).
1240
1296
  #
1241
1297
  # @param [Integer, #in_milliseconds, nil] timeout
1242
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1298
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
1243
1299
  # @param [Hash, nil] client_context the client context data, if set
1244
1300
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1245
1301
  #
@@ -1269,6 +1325,7 @@ module Couchbase
1269
1325
  def to_backend
1270
1326
  {
1271
1327
  timeout: Utils::Time.extract_duration(@timeout),
1328
+ retry_strategy: @retry_strategy,
1272
1329
  cas: @cas,
1273
1330
  durability_level: @durability_level,
1274
1331
  persist_to: @persist_to,
@@ -1317,7 +1374,7 @@ module Couchbase
1317
1374
  # +:four+:: wait for persistence to four nodes (active and replicas).
1318
1375
  #
1319
1376
  # @param [Integer, #in_milliseconds, nil] timeout
1320
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1377
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
1321
1378
  # @param [Hash, nil] client_context the client context data, if set
1322
1379
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1323
1380
  #
@@ -1347,6 +1404,7 @@ module Couchbase
1347
1404
  def to_backend
1348
1405
  {
1349
1406
  timeout: Utils::Time.extract_duration(@timeout),
1407
+ retry_strategy: @retry_strategy,
1350
1408
  cas: @cas,
1351
1409
  durability_level: @durability_level,
1352
1410
  persist_to: @persist_to,
@@ -1397,7 +1455,7 @@ module Couchbase
1397
1455
  # +:four+:: wait for persistence to four nodes (active and replicas).
1398
1456
  #
1399
1457
  # @param [Integer, #in_milliseconds, nil] timeout
1400
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1458
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
1401
1459
  # @param [Hash, nil] client_context the client context data, if set
1402
1460
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1403
1461
  #
@@ -1439,6 +1497,7 @@ module Couchbase
1439
1497
  def to_backend
1440
1498
  {
1441
1499
  timeout: Utils::Time.extract_duration(@timeout),
1500
+ retry_strategy: @retry_strategy,
1442
1501
  delta: @delta,
1443
1502
  initial_value: @initial,
1444
1503
  expiry: Utils::Time.extract_expiry_time(@expiry),
@@ -1491,7 +1550,7 @@ module Couchbase
1491
1550
  # +:four+:: wait for persistence to four nodes (active and replicas).
1492
1551
  #
1493
1552
  # @param [Integer, #in_milliseconds, nil] timeout
1494
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
1553
+ # @param [Symbol, nil] retry_strategy +:best_effort+ or +:fail_fast+; the cluster's default when +nil+
1495
1554
  # @param [Hash, nil] client_context the client context data, if set
1496
1555
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1497
1556
  #
@@ -1533,6 +1592,7 @@ module Couchbase
1533
1592
  def to_backend
1534
1593
  {
1535
1594
  timeout: Utils::Time.extract_duration(@timeout),
1595
+ retry_strategy: @retry_strategy,
1536
1596
  delta: @delta,
1537
1597
  initial_value: @initial,
1538
1598
  expiry: Utils::Time.extract_expiry_time(@expiry),
@@ -1919,20 +1979,25 @@ module Couchbase
1919
1979
  attr_accessor :report_id # @return [String]
1920
1980
  attr_accessor :service_types # @return [Array<Symbol>]
1921
1981
  attr_accessor :timeout # @return [Integer, #in_milliseconds]
1982
+ attr_accessor :parent_span # @return [Span, nil]
1922
1983
 
1923
1984
  # Creates an instance of options for {Couchbase::Bucket#ping}
1924
1985
  #
1925
1986
  # @param [String] report_id Holds custom report id.
1926
- # @@param [Array<Symbol>] service_types The service types to limit this diagnostics request
1987
+ # @param [Array<Symbol>] service_types The service types to limit this ping request
1927
1988
  # @param [Integer, #in_milliseconds] timeout
1989
+ # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1928
1990
  #
1929
1991
  # @yieldparam [Ping] self
1930
1992
  def initialize(report_id: nil,
1931
1993
  service_types: [:kv, :query, :analytics, :search, :views, :management],
1932
- timeout: nil)
1994
+ timeout: nil,
1995
+ parent_span: nil)
1933
1996
  @report_id = report_id
1934
1997
  @service_types = service_types
1935
1998
  @timeout = timeout
1999
+ @parent_span = parent_span
2000
+
1936
2001
  yield self if block_given?
1937
2002
  end
1938
2003
 
@@ -1949,6 +2014,41 @@ module Couchbase
1949
2014
  DEFAULT = Ping.new.freeze
1950
2015
  end
1951
2016
 
2017
+ # Options for {Couchbase::Cluster#wait_until_ready} and {Couchbase::Bucket#wait_until_ready}
2018
+ class WaitUntilReady
2019
+ attr_accessor :desired_state # @return [Symbol]
2020
+ attr_accessor :service_types # @return [Array<Symbol>, nil]
2021
+
2022
+ # Creates an instance of options for {Couchbase::Cluster#wait_until_ready} and {Couchbase::Bucket#wait_until_ready}
2023
+ #
2024
+ # @param [Symbol] desired_state the state to wait for
2025
+ # +:online+:: every endpoint the ping reports for each requested service responds
2026
+ # +:degraded+:: at least one endpoint the ping reports for each requested service responds
2027
+ # @param [Array<Symbol>, nil] service_types the service types to wait for (same names as {Ping#service_types}).
2028
+ # When +nil+ or empty, every service in the ping report is considered. A requested service that no node runs
2029
+ # is never ready, so the wait times out.
2030
+ #
2031
+ # @yieldparam [WaitUntilReady] self
2032
+ def initialize(desired_state: :online,
2033
+ service_types: nil)
2034
+ @desired_state = desired_state
2035
+ @service_types = service_types
2036
+
2037
+ yield self if block_given?
2038
+ end
2039
+
2040
+ # @api private
2041
+ def to_backend
2042
+ {
2043
+ desired_state: @desired_state,
2044
+ service_types: @service_types,
2045
+ }
2046
+ end
2047
+
2048
+ # @api private
2049
+ DEFAULT = WaitUntilReady.new.freeze
2050
+ end
2051
+
1952
2052
  # Options for {Couchbase::Cluster#analytics_query}
1953
2053
  class Analytics < Base
1954
2054
  attr_accessor :client_context_id # @return [String]
@@ -1986,7 +2086,7 @@ module Couchbase
1986
2086
  # The qualifier must be in form +{bucket_name}.{scope_name}+ or +default:{bucket_name}.{scope_name}+.
1987
2087
  #
1988
2088
  # @param [Integer, #in_milliseconds, nil] timeout
1989
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
2089
+ # @param [Symbol, nil] retry_strategy ignored by this operation
1990
2090
  # @param [Hash, nil] client_context the client context data, if set
1991
2091
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
1992
2092
  #
@@ -2038,10 +2138,10 @@ module Couchbase
2038
2138
 
2039
2139
  # Allows providing custom JSON key/value pairs for advanced usage
2040
2140
  #
2041
- # @param [String] key the parameter name (key of the JSON property)
2141
+ # @param [String, Symbol] key the parameter name (key of the JSON property), converted with +to_s+
2042
2142
  # @param [Object] value the parameter value (value of the JSON property)
2043
2143
  def raw(key, value)
2044
- @raw_parameters[key] = JSON.generate(value)
2144
+ @raw_parameters[key.to_s] = JSON.generate(value)
2045
2145
  end
2046
2146
 
2047
2147
  # @api private
@@ -2157,7 +2257,7 @@ module Couchbase
2157
2257
  # Overrides +scan_consistency+.
2158
2258
  #
2159
2259
  # @param [Integer, #in_milliseconds, nil] timeout
2160
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
2260
+ # @param [Symbol, nil] retry_strategy ignored by this operation
2161
2261
  # @param [Hash, nil] client_context the client context data, if set
2162
2262
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
2163
2263
  #
@@ -2215,10 +2315,10 @@ module Couchbase
2215
2315
 
2216
2316
  # Allows providing custom JSON key/value pairs for advanced usage
2217
2317
  #
2218
- # @param [String] key the parameter name (key of the JSON property)
2318
+ # @param [String, Symbol] key the parameter name (key of the JSON property), converted with +to_s+
2219
2319
  # @param [Object] value the parameter value (value of the JSON property)
2220
2320
  def raw(key, value)
2221
- @raw_parameters[key] = JSON.generate(value)
2321
+ @raw_parameters[key.to_s] = JSON.generate(value)
2222
2322
  end
2223
2323
 
2224
2324
  # Customizes the consistency guarantees for this query
@@ -2324,7 +2424,12 @@ module Couchbase
2324
2424
  attr_accessor :highlight_style # @return [Symbol]
2325
2425
  attr_accessor :highlight_fields # @return [Array<String>]
2326
2426
  attr_accessor :fields # @return [Array<String>]
2327
- attr_accessor :disable_scoring # @return [Boolean]
2427
+
2428
+ # @deprecated Use +scoring+ with {SearchScoring.none} instead
2429
+ # @return [Boolean]
2430
+ attr_accessor :disable_scoring
2431
+
2432
+ attr_accessor :scoring # @return [SearchScoring, nil]
2328
2433
  attr_accessor :include_locations # @return [Boolean]
2329
2434
  attr_accessor :collections # @return [Array<String>, nil]
2330
2435
  attr_accessor :sort # @return [Array<String, Cluster::SearchSort>]
@@ -2341,7 +2446,12 @@ module Couchbase
2341
2446
  # @param [Array<String>] fields list of field values which should be retrieved for result documents, provided they
2342
2447
  # were stored while indexing
2343
2448
  # @param [MutationState] mutation_state the mutation tokens this query should be consistent with
2344
- # @param [Boolean] disable_scoring If set to true, the server will not perform any scoring on the hits
2449
+ # @param [Boolean] disable_scoring DEPRECATED: Use +scoring+ with {SearchScoring.none} instead. If set to true,
2450
+ # the server will not perform any scoring on the hits.
2451
+ # @param [SearchScoring, nil] scoring specifies the scoring mode used for the request. For a
2452
+ # hybrid search (a traditional FTS query combined with one or more vector queries) a fusion strategy
2453
+ # controls how the FTS and vector result sets are merged into a single ranked list. Must not be used
2454
+ # together with +disable_scoring+.
2345
2455
  # @param [Boolean] include_locations UNCOMMITTED: If set to true, will include the vector of search_location in rows
2346
2456
  # @param [Array<String>, nil] collections list of collections by which to filter the results
2347
2457
  # @param [Array<String, Cluster::SearchSort>] sort Ordering rules to apply to the results. The list might contain
@@ -2354,7 +2464,7 @@ module Couchbase
2354
2464
  # @param [JsonTranscoder, #decode(String)] transcoder to use for the results
2355
2465
  #
2356
2466
  # @param [Integer, #in_milliseconds, nil] timeout
2357
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
2467
+ # @param [Symbol, nil] retry_strategy ignored by this operation
2358
2468
  # @param [Hash, nil] client_context the client context data, if set
2359
2469
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
2360
2470
  #
@@ -2367,6 +2477,7 @@ module Couchbase
2367
2477
  fields: nil,
2368
2478
  mutation_state: nil,
2369
2479
  disable_scoring: false,
2480
+ scoring: nil,
2370
2481
  include_locations: false,
2371
2482
  collections: nil,
2372
2483
  sort: nil,
@@ -2384,6 +2495,7 @@ module Couchbase
2384
2495
  @highlight_fields = highlight_fields
2385
2496
  @fields = fields
2386
2497
  @disable_scoring = disable_scoring
2498
+ @scoring = scoring
2387
2499
  @include_locations = include_locations
2388
2500
  @collections = collections
2389
2501
  @sort = sort
@@ -2427,14 +2539,22 @@ module Couchbase
2427
2539
  # @return [Symbol]
2428
2540
  attr_reader :scan_consistency
2429
2541
 
2542
+ # @api private
2543
+ def validate_scoring
2544
+ raise Error::InvalidArgument, "disable_scoring and scoring must not be used together" if @disable_scoring && !@scoring.nil?
2545
+ end
2546
+
2430
2547
  # @api private
2431
2548
  def to_backend(show_request: nil)
2549
+ validate_scoring
2550
+
2432
2551
  {
2433
2552
  timeout: Utils::Time.extract_duration(@timeout),
2434
2553
  limit: @limit,
2435
2554
  skip: @skip,
2436
2555
  explain: @explain,
2437
2556
  disable_scoring: @disable_scoring,
2557
+ scoring: @scoring&.to_backend,
2438
2558
  include_locations: @include_locations,
2439
2559
  collections: @collections,
2440
2560
  highlight_style: @highlight_style,
@@ -2515,7 +2635,7 @@ module Couchbase
2515
2635
  # @param [Boolean, nil] debug allows to return debug information as part of the view response
2516
2636
  #
2517
2637
  # @param [Integer, #in_milliseconds, nil] timeout
2518
- # @param [Proc, nil] retry_strategy the custom retry strategy, if set
2638
+ # @param [Symbol, nil] retry_strategy ignored by this operation
2519
2639
  # @param [Hash, nil] client_context the client context data, if set
2520
2640
  # @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
2521
2641
  #
@@ -2541,7 +2661,7 @@ module Couchbase
2541
2661
  retry_strategy: nil,
2542
2662
  client_context: nil,
2543
2663
  parent_span: nil)
2544
- super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
2664
+ super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span, &nil)
2545
2665
 
2546
2666
  @scan_consistency = scan_consistency
2547
2667
  @namespace = namespace
@@ -2560,15 +2680,24 @@ module Couchbase
2560
2680
  @reduce = reduce
2561
2681
  @on_error = on_error
2562
2682
  @debug = debug
2683
+ @raw_parameters = {}
2563
2684
  yield self if block_given?
2564
2685
  end
2565
2686
 
2566
- # Allows providing custom JSON key/value pairs for advanced usage
2687
+ # Allows providing custom query-string parameters for advanced usage
2567
2688
  #
2568
- # @param [String] key the parameter name (key of the JSON property)
2569
- # @param [Object] value the parameter value (value of the JSON property)
2689
+ # The SDK form-encodes the name and the value. A parameter that shares its name with a typed option is sent
2690
+ # in addition to it.
2691
+ #
2692
+ # @param [String, Symbol] key the parameter name
2693
+ # @param [Object] value the parameter value. A String must already be in the form the view engine expects,
2694
+ # such as JSON for +key+ or +keys+. Any other value is converted with +JSON.generate+.
2695
+ #
2696
+ # @example Pass parameters as raw values
2697
+ # options.raw("limit", 2) # limit=2
2698
+ # options.raw(:key, '"k2"') # key="k2", form-encoded
2570
2699
  def raw(key, value)
2571
- @raw_parameters[key] = JSON.generate(value)
2700
+ @raw_parameters[key.to_s] = value.is_a?(String) ? value : JSON.generate(value)
2572
2701
  end
2573
2702
 
2574
2703
  # @api private
@@ -2591,6 +2720,7 @@ module Couchbase
2591
2720
  reduce: @reduce,
2592
2721
  on_error: @on_error,
2593
2722
  debug: @debug,
2723
+ raw_parameters: @raw_parameters,
2594
2724
  }
2595
2725
  end
2596
2726
 
@@ -2669,6 +2799,13 @@ module Couchbase
2669
2799
  GetAnyReplica.new(**args)
2670
2800
  end
2671
2801
 
2802
+ # Construct {GetReplica} options for {Collection#get_replica}
2803
+ #
2804
+ # @return [GetReplica]
2805
+ def GetReplica(**args)
2806
+ GetReplica.new(**args)
2807
+ end
2808
+
2672
2809
  # Construct {Exists} options for {Collection#exists}
2673
2810
  #
2674
2811
  # @example Check if the document exists without fetching its contents