couchbase 3.4.0 → 3.4.1

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/ext/couchbase/CMakeLists.txt +8 -3
  4. data/ext/couchbase/cmake/CompilerWarnings.cmake +12 -4
  5. data/ext/couchbase/cmake/Documentation.cmake +4 -3
  6. data/ext/couchbase/cmake/OpenSSL.cmake +52 -7
  7. data/ext/couchbase/cmake/VersionInfo.cmake +39 -3
  8. data/ext/couchbase/cmake/test_openssl.cxx +7 -0
  9. data/ext/couchbase/core/crypto/CMakeLists.txt +5 -1
  10. data/ext/couchbase/core/impl/collection_query_index_manager.cxx +3 -3
  11. data/ext/couchbase/core/impl/get_all_query_indexes.cxx +3 -3
  12. data/ext/couchbase/core/impl/transaction_get_result.cxx +54 -0
  13. data/ext/couchbase/core/meta/CMakeLists.txt +7 -5
  14. data/ext/couchbase/core/meta/version.cxx +19 -0
  15. data/ext/couchbase/core/operations/document_search.cxx +5 -2
  16. data/ext/couchbase/core/operations/document_search.hxx +0 -1
  17. data/ext/couchbase/core/transactions/atr_cleanup_entry.cxx +1 -0
  18. data/ext/couchbase/core/transactions/attempt_context_impl.cxx +62 -31
  19. data/ext/couchbase/core/transactions/attempt_context_impl.hxx +43 -22
  20. data/ext/couchbase/core/transactions/forward_compat.hxx +2 -2
  21. data/ext/couchbase/core/transactions/internal/transaction_context.hxx +1 -1
  22. data/ext/couchbase/core/transactions/internal/transaction_fields.hxx +1 -0
  23. data/ext/couchbase/core/transactions/staged_mutation.cxx +1 -1
  24. data/ext/couchbase/core/transactions/staged_mutation.hxx +12 -2
  25. data/ext/couchbase/core/transactions/transaction_context.cxx +8 -11
  26. data/ext/couchbase/core/transactions/transaction_get_result.cxx +41 -31
  27. data/ext/couchbase/core/transactions/transaction_get_result.hxx +7 -3
  28. data/ext/couchbase/core/transactions/transaction_links.hxx +13 -1
  29. data/ext/couchbase/core/transactions/waitable_op_list.hxx +1 -0
  30. data/ext/couchbase/couchbase/cluster.hxx +2 -2
  31. data/ext/couchbase/couchbase/cluster_options.hxx +10 -10
  32. data/ext/couchbase/couchbase/collection.hxx +22 -17
  33. data/ext/couchbase/couchbase/collection_query_index_manager.hxx +1 -1
  34. data/ext/couchbase/couchbase/common_options.hxx +1 -1
  35. data/ext/couchbase/couchbase/configuration_profile.hxx +1 -1
  36. data/ext/couchbase/couchbase/configuration_profiles_registry.hxx +0 -1
  37. data/ext/couchbase/couchbase/create_primary_query_index_options.hxx +1 -1
  38. data/ext/couchbase/couchbase/drop_primary_query_index_options.hxx +1 -1
  39. data/ext/couchbase/couchbase/drop_query_index_options.hxx +1 -1
  40. data/ext/couchbase/couchbase/fmt/cas.hxx +12 -0
  41. data/ext/couchbase/couchbase/fmt/durability_level.hxx +6 -0
  42. data/ext/couchbase/couchbase/fmt/key_value_extended_error_info.hxx +6 -0
  43. data/ext/couchbase/couchbase/fmt/key_value_status_code.hxx +6 -0
  44. data/ext/couchbase/couchbase/fmt/mutation_token.hxx +6 -0
  45. data/ext/couchbase/couchbase/fmt/query_scan_consistency.hxx +6 -0
  46. data/ext/couchbase/couchbase/fmt/query_status.hxx +6 -0
  47. data/ext/couchbase/couchbase/fmt/retry_reason.hxx +6 -0
  48. data/ext/couchbase/couchbase/fmt/tls_verify_mode.hxx +6 -0
  49. data/ext/couchbase/couchbase/get_all_query_indexes_options.hxx +5 -4
  50. data/ext/couchbase/couchbase/query_index_manager.hxx +4 -2
  51. data/ext/couchbase/couchbase/scope.hxx +1 -1
  52. data/ext/couchbase/couchbase/subdoc/array_add_unique.hxx +2 -0
  53. data/ext/couchbase/couchbase/subdoc/array_append.hxx +2 -0
  54. data/ext/couchbase/couchbase/subdoc/array_insert.hxx +2 -0
  55. data/ext/couchbase/couchbase/subdoc/array_prepend.hxx +2 -0
  56. data/ext/couchbase/couchbase/subdoc/count.hxx +2 -0
  57. data/ext/couchbase/couchbase/subdoc/counter.hxx +2 -0
  58. data/ext/couchbase/couchbase/subdoc/exists.hxx +2 -0
  59. data/ext/couchbase/couchbase/subdoc/get.hxx +2 -0
  60. data/ext/couchbase/couchbase/subdoc/insert.hxx +2 -0
  61. data/ext/couchbase/couchbase/subdoc/remove.hxx +2 -0
  62. data/ext/couchbase/couchbase/subdoc/replace.hxx +3 -1
  63. data/ext/couchbase/couchbase/subdoc/upsert.hxx +2 -0
  64. data/ext/couchbase/couchbase/transaction_op_error_context.hxx +4 -4
  65. data/ext/couchbase/couchbase/transactions/transaction_get_result.hxx +36 -51
  66. data/ext/couchbase/couchbase/transactions/transactions_config.hxx +1 -1
  67. data/ext/couchbase/test/CMakeLists.txt +2 -0
  68. data/ext/couchbase/test/test_integration_examples.cxx +141 -0
  69. data/ext/couchbase/test/test_unit_transaction_utils.cxx +76 -19
  70. data/ext/couchbase.cxx +479 -20
  71. data/ext/extconf.rb +2 -1
  72. data/ext/revisions.rb +3 -2
  73. data/lib/couchbase/binary_collection.rb +4 -4
  74. data/lib/couchbase/collection.rb +5 -0
  75. data/lib/couchbase/errors.rb +10 -0
  76. data/lib/couchbase/management/collection_query_index_manager.rb +183 -0
  77. data/lib/couchbase/management/query_index_manager.rb +35 -3
  78. data/lib/couchbase/management.rb +1 -0
  79. data/lib/couchbase/options.rb +2 -3
  80. data/lib/couchbase/version.rb +1 -1
  81. metadata +9 -5
@@ -25,6 +25,7 @@ transaction_get_result::create_from(const core::operations::lookup_in_response&
25
25
  std::optional<std::string> atr_id;
26
26
  std::optional<std::string> transaction_id;
27
27
  std::optional<std::string> attempt_id;
28
+ std::optional<std::string> operation_id;
28
29
  std::optional<std::vector<std::byte>> staged_content;
29
30
  std::optional<std::string> atr_bucket_name;
30
31
  std::optional<std::string> atr_scope_name;
@@ -56,46 +57,49 @@ transaction_get_result::create_from(const core::operations::lookup_in_response&
56
57
  attempt_id = codec::tao_json_serializer::deserialize<std::string>(resp.fields[2].value);
57
58
  }
58
59
  if (resp.fields[3].status == key_value_status_code::success) {
59
- staged_content = resp.fields[3].value;
60
+ operation_id = codec::tao_json_serializer::deserialize<std::string>(resp.fields[3].value);
60
61
  }
61
62
  if (resp.fields[4].status == key_value_status_code::success) {
62
- atr_bucket_name = codec::tao_json_serializer::deserialize<std::string>(resp.fields[4].value);
63
+ staged_content = resp.fields[4].value;
63
64
  }
64
65
  if (resp.fields[5].status == key_value_status_code::success) {
65
- atr_scope_name = codec::tao_json_serializer::deserialize<std::string>(resp.fields[5].value);
66
+ atr_bucket_name = codec::tao_json_serializer::deserialize<std::string>(resp.fields[5].value);
66
67
  }
67
68
  if (resp.fields[6].status == key_value_status_code::success) {
68
- atr_collection_name = codec::tao_json_serializer::deserialize<std::string>(resp.fields[6].value);
69
+ atr_scope_name = codec::tao_json_serializer::deserialize<std::string>(resp.fields[6].value);
69
70
  }
70
-
71
71
  if (resp.fields[7].status == key_value_status_code::success) {
72
- auto restore = core::utils::json::parse_binary(resp.fields[7].value);
72
+ atr_collection_name = codec::tao_json_serializer::deserialize<std::string>(resp.fields[7].value);
73
+ }
74
+
75
+ if (resp.fields[8].status == key_value_status_code::success) {
76
+ auto restore = core::utils::json::parse_binary(resp.fields[8].value);
73
77
  cas_pre_txn = restore["CAS"].as<std::string>();
74
78
  // only present in 6.5+
75
79
  revid_pre_txn = restore["revid"].as<std::string>();
76
80
  exptime_pre_txn = restore["exptime"].as<std::uint32_t>();
77
81
  }
78
- if (resp.fields[8].status == key_value_status_code::success) {
79
- op = codec::tao_json_serializer::deserialize<std::string>(resp.fields[8].value);
80
- }
81
82
  if (resp.fields[9].status == key_value_status_code::success) {
82
- auto doc = core::utils::json::parse_binary(resp.fields[9].value);
83
+ op = codec::tao_json_serializer::deserialize<std::string>(resp.fields[9].value);
84
+ }
85
+ if (resp.fields[10].status == key_value_status_code::success) {
86
+ auto doc = core::utils::json::parse_binary(resp.fields[10].value);
83
87
  cas_from_doc = doc["CAS"].as<std::string>();
84
88
  // only present in 6.5+
85
89
  revid_from_doc = doc["revid"].as<std::string>();
86
90
  exptime_from_doc = doc["exptime"].as<std::uint32_t>();
87
91
  crc32_from_doc = doc["value_crc32c"].as<std::string>();
88
92
  }
89
- if (resp.fields[10].status == key_value_status_code::success) {
90
- crc32_of_staging = codec::tao_json_serializer::deserialize<std::string>(resp.fields[10].value);
91
- }
92
93
  if (resp.fields[11].status == key_value_status_code::success) {
93
- forward_compat = core::utils::json::parse_binary(resp.fields[11].value);
94
+ crc32_of_staging = codec::tao_json_serializer::deserialize<std::string>(resp.fields[11].value);
95
+ }
96
+ if (resp.fields[12].status == key_value_status_code::success) {
97
+ forward_compat = core::utils::json::parse_binary(resp.fields[12].value);
94
98
  } else {
95
99
  forward_compat = tao::json::empty_object;
96
100
  }
97
- if (resp.fields[12].status == key_value_status_code::success) {
98
- content = resp.fields[12].value;
101
+ if (resp.fields[13].status == key_value_status_code::success) {
102
+ content = resp.fields[13].value;
99
103
  }
100
104
 
101
105
  transaction_links links(atr_id,
@@ -104,6 +108,7 @@ transaction_get_result::create_from(const core::operations::lookup_in_response&
104
108
  atr_collection_name,
105
109
  transaction_id,
106
110
  attempt_id,
111
+ operation_id,
107
112
  staged_content,
108
113
  cas_pre_txn,
109
114
  revid_pre_txn,
@@ -126,6 +131,7 @@ transaction_get_result::create_from(const core::document_id& id, const result& r
126
131
  std::optional<std::string> atr_id;
127
132
  std::optional<std::string> transaction_id;
128
133
  std::optional<std::string> attempt_id;
134
+ std::optional<std::string> operation_id;
129
135
  std::optional<std::vector<std::byte>> staged_content;
130
136
  std::optional<std::string> atr_bucket_name;
131
137
  std::optional<std::string> atr_scope_name;
@@ -157,45 +163,48 @@ transaction_get_result::create_from(const core::document_id& id, const result& r
157
163
  attempt_id = res.values[2].content_as<std::string>();
158
164
  }
159
165
  if (res.values[3].has_value()) {
160
- staged_content = res.values[3].raw_value;
166
+ operation_id = res.values[3].content_as<std::string>();
161
167
  }
162
168
  if (res.values[4].has_value()) {
163
- atr_bucket_name = res.values[4].content_as<std::string>();
169
+ staged_content = res.values[4].raw_value;
164
170
  }
165
171
  if (res.values[5].has_value()) {
166
- atr_scope_name = res.values[5].content_as<std::string>();
172
+ atr_bucket_name = res.values[5].content_as<std::string>();
167
173
  }
168
174
  if (res.values[6].has_value()) {
169
- atr_collection_name = res.values[6].content_as<std::string>();
175
+ atr_scope_name = res.values[6].content_as<std::string>();
170
176
  }
171
177
  if (res.values[7].has_value()) {
172
- auto restore = res.values[7].content_as();
178
+ atr_collection_name = res.values[7].content_as<std::string>();
179
+ }
180
+ if (res.values[8].has_value()) {
181
+ auto restore = res.values[8].content_as();
173
182
  cas_pre_txn = restore["CAS"].as<std::string>();
174
183
  // only present in 6.5+
175
184
  revid_pre_txn = restore["revid"].as<std::string>();
176
185
  exptime_pre_txn = restore["exptime"].as<std::uint32_t>();
177
186
  }
178
- if (res.values[8].has_value()) {
179
- op = res.values[8].content_as<std::string>();
180
- }
181
187
  if (res.values[9].has_value()) {
182
- auto doc = res.values[9].content_as();
188
+ op = res.values[9].content_as<std::string>();
189
+ }
190
+ if (res.values[10].has_value()) {
191
+ auto doc = res.values[10].content_as();
183
192
  cas_from_doc = doc["CAS"].as<std::string>();
184
193
  // only present in 6.5+
185
194
  revid_from_doc = doc["revid"].as<std::string>();
186
195
  exptime_from_doc = doc["exptime"].as<std::uint32_t>();
187
196
  crc32_from_doc = doc["value_crc32c"].as<std::string>();
188
197
  }
189
- if (res.values[10].has_value()) {
190
- crc32_of_staging = res.values[10].content_as<std::string>();
191
- }
192
198
  if (res.values[11].has_value()) {
193
- forward_compat = res.values[11].content_as();
199
+ crc32_of_staging = res.values[11].content_as<std::string>();
200
+ }
201
+ if (res.values[12].has_value()) {
202
+ forward_compat = res.values[12].content_as();
194
203
  } else {
195
204
  forward_compat = tao::json::empty_object;
196
205
  }
197
- if (res.values[12].has_value()) {
198
- content = res.values[12].raw_value;
206
+ if (res.values[13].has_value()) {
207
+ content = res.values[13].raw_value;
199
208
  }
200
209
 
201
210
  transaction_links links(atr_id,
@@ -204,6 +213,7 @@ transaction_get_result::create_from(const core::document_id& id, const result& r
204
213
  atr_collection_name,
205
214
  transaction_id,
206
215
  attempt_id,
216
+ operation_id,
207
217
  staged_content,
208
218
  cas_pre_txn,
209
219
  revid_pre_txn,
@@ -77,16 +77,19 @@ class transaction_get_result
77
77
  {
78
78
  }
79
79
 
80
- transaction_get_result(const couchbase::transactions::transaction_get_result& res)
80
+ explicit transaction_get_result(const couchbase::transactions::transaction_get_result& res)
81
81
  : cas_(res.cas())
82
82
  , document_id_(res.bucket(), res.scope(), res.collection(), res.key())
83
- , content_(res.content())
83
+ , links_(res.base_->links())
84
+ , content_(std::move(res.content()))
85
+ , metadata_(res.base_->metadata_)
84
86
  {
85
87
  }
86
88
 
87
89
  couchbase::transactions::transaction_get_result to_public_result()
88
90
  {
89
- return { document_id_.bucket(), document_id_.scope(), document_id_.collection(), document_id_.key(), cas_, std::move(content_) };
91
+ return couchbase::transactions::transaction_get_result(
92
+ std::make_shared<transaction_get_result>(document_id_, std::move(content_), cas_.value(), links_, metadata_));
90
93
  }
91
94
 
92
95
  transaction_get_result(core::document_id id, const tao::json::value& json)
@@ -126,6 +129,7 @@ class transaction_get_result
126
129
  document.links().atr_collection_name(),
127
130
  document.links().staged_transaction_id(),
128
131
  document.links().staged_attempt_id(),
132
+ document.links().staged_operation_id(),
129
133
  document.links().staged_content(),
130
134
  document.links().cas_pre_txn(),
131
135
  document.links().revid_pre_txn(),
@@ -35,6 +35,7 @@ class transaction_links
35
35
  // id of the transaction that has staged content
36
36
  std::optional<std::string> staged_transaction_id_;
37
37
  std::optional<std::string> staged_attempt_id_;
38
+ std::optional<std::string> staged_operation_id_;
38
39
  std::optional<std::vector<std::byte>> staged_content_;
39
40
 
40
41
  // for {BACKUP_FIELDS}
@@ -54,6 +55,7 @@ class transaction_links
54
55
  std::optional<std::string> atr_collection_name,
55
56
  std::optional<std::string> staged_transaction_id,
56
57
  std::optional<std::string> staged_attempt_id,
58
+ std::optional<std::string> staged_operation_id,
57
59
  std::optional<std::vector<std::byte>> staged_content,
58
60
  std::optional<std::string> cas_pre_txn,
59
61
  std::optional<std::string> revid_pre_txn,
@@ -68,6 +70,7 @@ class transaction_links
68
70
  , atr_collection_name_(std::move(atr_collection_name))
69
71
  , staged_transaction_id_(std::move(staged_transaction_id))
70
72
  , staged_attempt_id_(std::move(staged_attempt_id))
73
+ , staged_operation_id_(std::move(staged_operation_id))
71
74
  , staged_content_(std::move(staged_content))
72
75
  , cas_pre_txn_(std::move(cas_pre_txn))
73
76
  , revid_pre_txn_(std::move(revid_pre_txn))
@@ -111,6 +114,9 @@ class transaction_links
111
114
  if (staged_transaction_id_) {
112
115
  obj["txnMeta"]["txn"] = staged_transaction_id_.value();
113
116
  }
117
+ if (staged_operation_id_) {
118
+ obj["txnMeta"]["txn"] = staged_operation_id_.value();
119
+ }
114
120
  if (atr_id_) {
115
121
  obj["txnMeta"]["atr"]["key"] = atr_id_.value();
116
122
  }
@@ -181,6 +187,11 @@ class transaction_links
181
187
  return staged_attempt_id_;
182
188
  }
183
189
 
190
+ [[nodiscard]] std::optional<std::string> staged_operation_id() const
191
+ {
192
+ return staged_operation_id_;
193
+ }
194
+
184
195
  [[nodiscard]] std::optional<std::string> cas_pre_txn() const
185
196
  {
186
197
  return cas_pre_txn_;
@@ -241,12 +252,13 @@ struct fmt::formatter<couchbase::core::transactions::transaction_links> {
241
252
  constexpr auto format(const couchbase::core::transactions::transaction_links& r, FormatContext& ctx) const
242
253
  {
243
254
  return format_to(ctx.out(),
244
- "transaction_links:{{ atr: {}.{}.{}.{}, txn_id: {}, attempt_id: {}, crc32_of_staging: {} }}",
255
+ "transaction_links:{{ atr: {}.{}.{}.{}, txn_id: {}, attempt_id: {}, operation_id: {}, crc32_of_staging: {} }}",
245
256
  r.atr_bucket_name().value_or("none"),
246
257
  r.atr_scope_name().value_or("none"),
247
258
  r.atr_collection_name().value_or("none"),
248
259
  r.atr_id().value_or("none"),
249
260
  r.staged_attempt_id().value_or("none"),
261
+ r.staged_operation_id().value_or("none"),
250
262
  r.crc32_of_staging().value_or("none"));
251
263
  }
252
264
  };
@@ -119,6 +119,7 @@ class waitable_op_list
119
119
  // calling the callback). So wait for that.
120
120
  CB_TXN_LOG_TRACE("set_query_mode: mode already query, waiting for node to be set...");
121
121
  cv_query_.wait(lock, [this]() { return !mode_.query_node.empty(); });
122
+ cv_in_flight_.wait(lock, [this]() { return 0 == in_flight_; });
122
123
  in_flight_++;
123
124
  CB_TXN_LOG_TRACE("set_query_mode: node set, continuing...");
124
125
  lock.unlock();
@@ -59,7 +59,7 @@ class cluster
59
59
  * @param handler the handler that implements @ref cluster_connect_handler
60
60
  *
61
61
  * @since 1.0.0
62
- * @comitted
62
+ * @committed
63
63
  */
64
64
  template<typename Handler>
65
65
  static void connect(asio::io_context& io, const std::string& connection_string, const cluster_options& options, Handler&& handler)
@@ -77,7 +77,7 @@ class cluster
77
77
  * @return future object that carries cluster object and operation status
78
78
  *
79
79
  * @since 1.0.0
80
- * @comitted
80
+ * @committed
81
81
  */
82
82
  [[nodiscard]] static auto connect(asio::io_context& io, const std::string& connection_string, const cluster_options& options)
83
83
  -> std::future<std::pair<cluster, std::error_code>>
@@ -54,7 +54,7 @@ class cluster_options
54
54
  * @param password
55
55
  *
56
56
  * @since 1.0.0
57
- * @comitted
57
+ * @committed
58
58
  */
59
59
  cluster_options(std::string username, std::string password)
60
60
  : username_{ std::move(username) }
@@ -67,7 +67,7 @@ class cluster_options
67
67
  * @param authenticator
68
68
  *
69
69
  * @since 1.0.0
70
- * @comitted
70
+ * @committed
71
71
  */
72
72
  explicit cluster_options(password_authenticator authenticator)
73
73
  : username_{ std::move(authenticator.username_) }
@@ -83,7 +83,7 @@ class cluster_options
83
83
  * @param authenticator
84
84
  *
85
85
  * @since 1.0.0
86
- * @comitted
86
+ * @committed
87
87
  */
88
88
  explicit cluster_options(certificate_authenticator authenticator)
89
89
  : certificate_path_{ std::move(authenticator.certificate_path_) }
@@ -115,7 +115,7 @@ class cluster_options
115
115
  * @return compression options
116
116
  *
117
117
  * @since 1.0.0
118
- * @comitted
118
+ * @committed
119
119
  */
120
120
  [[nodiscard]] auto compression() -> compression_options&
121
121
  {
@@ -128,7 +128,7 @@ class cluster_options
128
128
  * @return timeout options
129
129
  *
130
130
  * @since 1.0.0
131
- * @comitted
131
+ * @committed
132
132
  */
133
133
  [[nodiscard]] auto timeouts() -> timeout_options&
134
134
  {
@@ -141,7 +141,7 @@ class cluster_options
141
141
  * @return DNS options
142
142
  *
143
143
  * @since 1.0.0
144
- * @comitted
144
+ * @committed
145
145
  */
146
146
  [[nodiscard]] auto dns() -> dns_options&
147
147
  {
@@ -154,7 +154,7 @@ class cluster_options
154
154
  * @return security options
155
155
  *
156
156
  * @since 1.0.0
157
- * @comitted
157
+ * @committed
158
158
  */
159
159
  [[nodiscard]] auto security() -> security_options&
160
160
  {
@@ -167,7 +167,7 @@ class cluster_options
167
167
  * @return network options
168
168
  *
169
169
  * @since 1.0.0
170
- * @comitted
170
+ * @committed
171
171
  */
172
172
  [[nodiscard]] auto network() -> network_options&
173
173
  {
@@ -180,7 +180,7 @@ class cluster_options
180
180
  * @return metrics options
181
181
  *
182
182
  * @since 1.0.0
183
- * @comitted
183
+ * @committed
184
184
  */
185
185
  [[nodiscard]] auto metrics() -> metrics_options&
186
186
  {
@@ -193,7 +193,7 @@ class cluster_options
193
193
  * @return tracing options
194
194
  *
195
195
  * @since 1.0.0
196
- * @comitted
196
+ * @committed
197
197
  */
198
198
  [[nodiscard]] auto tracing() -> tracing_options&
199
199
  {
@@ -161,7 +161,7 @@ class collection
161
161
  * @since 1.0.0
162
162
  * @committed
163
163
  */
164
- [[nodiscard]] auto get(std::string document_id, const get_options& options) const
164
+ [[nodiscard]] auto get(std::string document_id, const get_options& options = {}) const
165
165
  -> std::future<std::pair<key_value_error_context, get_result>>
166
166
  {
167
167
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, get_result>>>();
@@ -220,7 +220,9 @@ class collection
220
220
  * @since 1.0.0
221
221
  * @committed
222
222
  */
223
- [[nodiscard]] auto get_and_touch(std::string document_id, std::chrono::seconds duration, const get_and_touch_options& options) const
223
+ [[nodiscard]] auto get_and_touch(std::string document_id,
224
+ std::chrono::seconds duration,
225
+ const get_and_touch_options& options = {}) const
224
226
  -> std::future<std::pair<key_value_error_context, get_result>>
225
227
  {
226
228
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, get_result>>>();
@@ -281,7 +283,7 @@ class collection
281
283
  */
282
284
  [[nodiscard]] auto get_and_touch(std::string document_id,
283
285
  std::chrono::system_clock::time_point time_point,
284
- const get_and_touch_options& options) const
286
+ const get_and_touch_options& options = {}) const
285
287
  -> std::future<std::pair<key_value_error_context, get_result>>
286
288
  {
287
289
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, get_result>>>();
@@ -337,7 +339,7 @@ class collection
337
339
  * @since 1.0.0
338
340
  * @committed
339
341
  */
340
- [[nodiscard]] auto touch(std::string document_id, std::chrono::seconds duration, const touch_options& options) const
342
+ [[nodiscard]] auto touch(std::string document_id, std::chrono::seconds duration, const touch_options& options = {}) const
341
343
  -> std::future<std::pair<key_value_error_context, result>>
342
344
  {
343
345
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, result>>>();
@@ -396,8 +398,9 @@ class collection
396
398
  * @since 1.0.0
397
399
  * @committed
398
400
  */
399
- [[nodiscard]] auto touch(std::string document_id, std::chrono::system_clock::time_point time_point, const touch_options& options) const
400
- -> std::future<std::pair<key_value_error_context, result>>
401
+ [[nodiscard]] auto touch(std::string document_id,
402
+ std::chrono::system_clock::time_point time_point,
403
+ const touch_options& options = {}) const -> std::future<std::pair<key_value_error_context, result>>
401
404
  {
402
405
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, result>>>();
403
406
  auto future = barrier->get_future();
@@ -450,7 +453,7 @@ class collection
450
453
  * @since 1.0.0
451
454
  * @committed
452
455
  */
453
- [[nodiscard]] auto get_any_replica(std::string document_id, const get_any_replica_options& options) const
456
+ [[nodiscard]] auto get_any_replica(std::string document_id, const get_any_replica_options& options = {}) const
454
457
  -> std::future<std::pair<key_value_error_context, get_replica_result>>
455
458
  {
456
459
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, get_replica_result>>>();
@@ -502,7 +505,7 @@ class collection
502
505
  * @since 1.0.0
503
506
  * @committed
504
507
  */
505
- [[nodiscard]] auto get_all_replicas(std::string document_id, const get_all_replicas_options& options) const
508
+ [[nodiscard]] auto get_all_replicas(std::string document_id, const get_all_replicas_options& options = {}) const
506
509
  -> std::future<std::pair<key_value_error_context, get_all_replicas_result>>
507
510
  {
508
511
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, get_all_replicas_result>>>();
@@ -562,7 +565,7 @@ class collection
562
565
  * @committed
563
566
  */
564
567
  template<typename Transcoder = codec::default_json_transcoder, typename Document>
565
- [[nodiscard]] auto upsert(std::string document_id, const Document& document, const upsert_options& options) const
568
+ [[nodiscard]] auto upsert(std::string document_id, const Document& document, const upsert_options& options = {}) const
566
569
  -> std::future<std::pair<key_value_error_context, mutation_result>>
567
570
  {
568
571
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, mutation_result>>>();
@@ -624,7 +627,7 @@ class collection
624
627
  * @committed
625
628
  */
626
629
  template<typename Transcoder = codec::default_json_transcoder, typename Document>
627
- [[nodiscard]] auto insert(std::string document_id, const Document& document, const insert_options& options) const
630
+ [[nodiscard]] auto insert(std::string document_id, const Document& document, const insert_options& options = {}) const
628
631
  -> std::future<std::pair<key_value_error_context, mutation_result>>
629
632
  {
630
633
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, mutation_result>>>();
@@ -688,7 +691,7 @@ class collection
688
691
  * @committed
689
692
  */
690
693
  template<typename Transcoder = codec::default_json_transcoder, typename Document>
691
- [[nodiscard]] auto replace(std::string document_id, const Document& document, const replace_options& options) const
694
+ [[nodiscard]] auto replace(std::string document_id, const Document& document, const replace_options& options = {}) const
692
695
  -> std::future<std::pair<key_value_error_context, mutation_result>>
693
696
  {
694
697
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, mutation_result>>>();
@@ -738,7 +741,7 @@ class collection
738
741
  * @since 1.0.0
739
742
  * @committed
740
743
  */
741
- [[nodiscard]] auto remove(std::string document_id, const remove_options& options) const
744
+ [[nodiscard]] auto remove(std::string document_id, const remove_options& options = {}) const
742
745
  -> std::future<std::pair<key_value_error_context, mutation_result>>
743
746
  {
744
747
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, mutation_result>>>();
@@ -792,7 +795,7 @@ class collection
792
795
  * @since 1.0.0
793
796
  * @committed
794
797
  */
795
- [[nodiscard]] auto mutate_in(std::string document_id, mutate_in_specs specs, const mutate_in_options& options) const
798
+ [[nodiscard]] auto mutate_in(std::string document_id, mutate_in_specs specs, const mutate_in_options& options = {}) const
796
799
  -> std::future<std::pair<subdocument_error_context, mutate_in_result>>
797
800
  {
798
801
  auto barrier = std::make_shared<std::promise<std::pair<subdocument_error_context, mutate_in_result>>>();
@@ -842,7 +845,7 @@ class collection
842
845
  * @since 1.0.0
843
846
  * @committed
844
847
  */
845
- [[nodiscard]] auto lookup_in(std::string document_id, lookup_in_specs specs, const lookup_in_options& options) const
848
+ [[nodiscard]] auto lookup_in(std::string document_id, lookup_in_specs specs, const lookup_in_options& options = {}) const
846
849
  -> std::future<std::pair<subdocument_error_context, lookup_in_result>>
847
850
  {
848
851
  auto barrier = std::make_shared<std::promise<std::pair<subdocument_error_context, lookup_in_result>>>();
@@ -887,7 +890,9 @@ class collection
887
890
  * @since 1.0.0
888
891
  * @committed
889
892
  */
890
- [[nodiscard]] auto get_and_lock(std::string document_id, std::chrono::seconds lock_duration, const get_and_lock_options& options) const
893
+ [[nodiscard]] auto get_and_lock(std::string document_id,
894
+ std::chrono::seconds lock_duration,
895
+ const get_and_lock_options& options = {}) const
891
896
  -> std::future<std::pair<key_value_error_context, get_result>>
892
897
  {
893
898
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, get_result>>>();
@@ -939,7 +944,7 @@ class collection
939
944
  * @since 1.0.0
940
945
  * @committed
941
946
  */
942
- [[nodiscard]] auto unlock(std::string document_id, couchbase::cas cas, const unlock_options& options) const
947
+ [[nodiscard]] auto unlock(std::string document_id, couchbase::cas cas, const unlock_options& options = {}) const
943
948
  -> std::future<key_value_error_context>
944
949
  {
945
950
  auto barrier = std::make_shared<std::promise<key_value_error_context>>();
@@ -983,7 +988,7 @@ class collection
983
988
  * @since 1.0.0
984
989
  * @committed
985
990
  */
986
- [[nodiscard]] auto exists(std::string document_id, const exists_options& options) const
991
+ [[nodiscard]] auto exists(std::string document_id, const exists_options& options = {}) const
987
992
  -> std::future<std::pair<key_value_error_context, exists_result>>
988
993
  {
989
994
  auto barrier = std::make_shared<std::promise<std::pair<key_value_error_context, exists_result>>>();
@@ -61,7 +61,7 @@ class collection_query_index_manager
61
61
  * @since 1.0.0
62
62
  * @committed
63
63
  */
64
- void get_all_indexes(const get_all_query_indexes_options& options, get_all_indexes_handler&& handler) const;
64
+ void get_all_indexes(const get_all_query_indexes_options& options, get_all_query_indexes_handler&& handler) const;
65
65
 
66
66
  [[nodiscard]] auto get_all_indexes(const get_all_query_indexes_options& options) const
67
67
  -> std::future<std::pair<manager_error_context, std::vector<couchbase::management::query::index>>>
@@ -55,7 +55,7 @@ class common_options
55
55
  }
56
56
 
57
57
  /**
58
- * Specifies a custom {@link retry_strategy} for this operation.
58
+ * Specifies a custom {@link couchbase::retry_strategy} for this operation.
59
59
  *
60
60
  * @param strategy the retry strategy to use for this operation.
61
61
  * @return this options builder for chaining purposes.
@@ -25,7 +25,7 @@ class cluster_options;
25
25
  /**
26
26
  * Base class for all defined configuration profiles
27
27
  *
28
- * Just implement the apply function, and register it. See @ref configuration_profiles_registry#register()
28
+ * Just implement the apply function, and register it. See @ref configuration_profiles_registry#register_profile()
29
29
  */
30
30
  class configuration_profile
31
31
  {
@@ -30,7 +30,6 @@ class cluster_options;
30
30
  /**
31
31
  * Registry for defining configuration profiles.
32
32
  */
33
-
34
33
  class configuration_profiles_registry
35
34
  {
36
35
  public:
@@ -32,7 +32,7 @@ class create_primary_query_index_options : public common_options<create_primary_
32
32
  /**
33
33
  * Give the primary index a name
34
34
  *
35
- * defaults to #primary
35
+ * defaults to `#primary`
36
36
  *
37
37
  * @param index_name
38
38
  * @return reference to this object, for use in chaining.
@@ -46,7 +46,7 @@ class drop_primary_query_index_options : public common_options<drop_primary_quer
46
46
  *
47
47
  * The default is to not ignore the error.
48
48
  *
49
- * @param ignore_if_exists if true, we don't return an error if the index already exists
49
+ * @param ignore_if_not_exists if true, we don't return an error if the index already exists
50
50
  * @return reference to this object, for use in chaining.
51
51
  *
52
52
  * @since 1.0.0
@@ -34,7 +34,7 @@ class drop_query_index_options : public common_options<drop_query_index_options>
34
34
  *
35
35
  * The default is to not ignore the error.
36
36
  *
37
- * @param ignore_if_exists if true, we don't return an error if the index already exists
37
+ * @param ignore_if_not_exists if true, we don't return an error if the index already exists
38
38
  * @return reference to this object, for use in chaining.
39
39
  *
40
40
  * @since 1.0.0
@@ -21,6 +21,18 @@
21
21
 
22
22
  #include <fmt/core.h>
23
23
 
24
+ #ifdef COUCHBASE_CXX_CLIENT_DOXYGEN
25
+ namespace fmt
26
+ {
27
+ }
28
+ #endif
29
+
30
+ /**
31
+ * Helper for fmtlib to format @ref couchbase::cas objects.
32
+ *
33
+ * @since 1.0.0
34
+ * @committed
35
+ */
24
36
  template<>
25
37
  struct fmt::formatter<couchbase::cas> {
26
38
  template<typename ParseContext>
@@ -21,6 +21,12 @@
21
21
 
22
22
  #include <fmt/core.h>
23
23
 
24
+ /**
25
+ * Helper for fmtlib to format @ref couchbase::durability_level objects.
26
+ *
27
+ * @since 1.0.0
28
+ * @committed
29
+ */
24
30
  template<>
25
31
  struct fmt::formatter<couchbase::durability_level> {
26
32
  template<typename ParseContext>
@@ -21,6 +21,12 @@
21
21
 
22
22
  #include <fmt/core.h>
23
23
 
24
+ /**
25
+ * Helper for fmtlib to format @ref couchbase::key_value_extended_error_info objects.
26
+ *
27
+ * @since 1.0.0
28
+ * @committed
29
+ */
24
30
  template<>
25
31
  struct fmt::formatter<couchbase::key_value_extended_error_info> {
26
32
  template<typename ParseContext>
@@ -21,6 +21,12 @@
21
21
 
22
22
  #include <fmt/core.h>
23
23
 
24
+ /**
25
+ * Helper for fmtlib to format @ref couchbase::key_value_status_code objects.
26
+ *
27
+ * @since 1.0.0
28
+ * @committed
29
+ */
24
30
  template<>
25
31
  struct fmt::formatter<couchbase::key_value_status_code> {
26
32
  template<typename ParseContext>
@@ -21,6 +21,12 @@
21
21
 
22
22
  #include <fmt/core.h>
23
23
 
24
+ /**
25
+ * Helper for fmtlib to format @ref couchbase::mutation_token objects.
26
+ *
27
+ * @since 1.0.0
28
+ * @committed
29
+ */
24
30
  template<>
25
31
  struct fmt::formatter<couchbase::mutation_token> {
26
32
  template<typename ParseContext>