couchbase 4.2.5 → 4.2.6-dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. package/deps/couchbase-cxx-client/CMakeLists.txt +9 -1
  2. package/deps/couchbase-cxx-client/bin/api.rb +234 -0
  3. package/deps/couchbase-cxx-client/bin/create-search-index +18 -135
  4. package/deps/couchbase-cxx-client/bin/init-cluster +17 -139
  5. package/deps/couchbase-cxx-client/bin/load-sample-buckets +54 -0
  6. package/deps/couchbase-cxx-client/core/cluster.hxx +33 -12
  7. package/deps/couchbase-cxx-client/core/cluster_options.hxx +3 -0
  8. package/deps/couchbase-cxx-client/core/crud_component.cxx +51 -22
  9. package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +115 -50
  10. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +6 -0
  11. package/deps/couchbase-cxx-client/core/impl/create_bucket.cxx +155 -0
  12. package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +172 -59
  13. package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +2 -1
  14. package/deps/couchbase-cxx-client/core/impl/drop_bucket.cxx +66 -0
  15. package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +138 -59
  16. package/deps/couchbase-cxx-client/core/impl/flush_bucket.cxx +66 -0
  17. package/deps/couchbase-cxx-client/core/impl/get_all_buckets.cxx +163 -0
  18. package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +67 -37
  19. package/deps/couchbase-cxx-client/core/impl/get_bucket.cxx +153 -0
  20. package/deps/couchbase-cxx-client/core/impl/internal_manager_error_context.cxx +113 -0
  21. package/deps/couchbase-cxx-client/core/impl/internal_manager_error_context.hxx +60 -0
  22. package/deps/couchbase-cxx-client/core/impl/key_value_error_category.cxx +2 -4
  23. package/deps/couchbase-cxx-client/core/impl/manager_error_context.cxx +100 -0
  24. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  25. package/deps/couchbase-cxx-client/core/impl/update_bucket.cxx +130 -0
  26. package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +53 -29
  27. package/deps/couchbase-cxx-client/core/io/dns_client.cxx +71 -38
  28. package/deps/couchbase-cxx-client/core/io/dns_config.cxx +5 -4
  29. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +5 -6
  30. package/deps/couchbase-cxx-client/core/meta/features.hxx +6 -0
  31. package/deps/couchbase-cxx-client/core/operations/document_query.cxx +11 -0
  32. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  33. package/deps/couchbase-cxx-client/core/origin.cxx +270 -0
  34. package/deps/couchbase-cxx-client/core/origin.hxx +2 -0
  35. package/deps/couchbase-cxx-client/core/protocol/status.cxx +2 -2
  36. package/deps/couchbase-cxx-client/core/range_scan_options.cxx +3 -27
  37. package/deps/couchbase-cxx-client/core/range_scan_options.hxx +13 -17
  38. package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +367 -170
  39. package/deps/couchbase-cxx-client/core/range_scan_orchestrator.hxx +13 -2
  40. package/deps/couchbase-cxx-client/core/range_scan_orchestrator_options.hxx +5 -3
  41. package/deps/couchbase-cxx-client/core/scan_options.hxx +0 -19
  42. package/deps/couchbase-cxx-client/core/scan_result.cxx +19 -5
  43. package/deps/couchbase-cxx-client/core/scan_result.hxx +5 -2
  44. package/deps/couchbase-cxx-client/core/timeout_defaults.hxx +2 -3
  45. package/deps/couchbase-cxx-client/core/topology/capabilities.hxx +1 -0
  46. package/deps/couchbase-cxx-client/core/topology/capabilities_fmt.hxx +2 -0
  47. package/deps/couchbase-cxx-client/core/topology/collections_manifest_fmt.hxx +1 -1
  48. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +5 -0
  49. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +2 -0
  50. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +4 -0
  51. package/deps/couchbase-cxx-client/couchbase/behavior_options.hxx +19 -2
  52. package/deps/couchbase-cxx-client/couchbase/bucket_manager.hxx +135 -0
  53. package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +0 -30
  54. package/deps/couchbase-cxx-client/couchbase/cluster.hxx +14 -0
  55. package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +7 -48
  56. package/deps/couchbase-cxx-client/couchbase/create_bucket_options.hxx +41 -0
  57. package/deps/couchbase-cxx-client/couchbase/create_primary_query_index_options.hxx +0 -29
  58. package/deps/couchbase-cxx-client/couchbase/create_query_index_options.hxx +0 -33
  59. package/deps/couchbase-cxx-client/couchbase/drop_bucket_options.hxx +41 -0
  60. package/deps/couchbase-cxx-client/couchbase/drop_primary_query_index_options.hxx +0 -30
  61. package/deps/couchbase-cxx-client/couchbase/drop_query_index_options.hxx +0 -31
  62. package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +1 -2
  63. package/deps/couchbase-cxx-client/couchbase/flush_bucket_options.hxx +41 -0
  64. package/deps/couchbase-cxx-client/couchbase/get_all_buckets_options.hxx +44 -0
  65. package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +0 -30
  66. package/deps/couchbase-cxx-client/couchbase/get_bucket_options.hxx +43 -0
  67. package/deps/couchbase-cxx-client/couchbase/management/bucket_settings.hxx +116 -0
  68. package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +29 -53
  69. package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +16 -83
  70. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +18 -0
  71. package/deps/couchbase-cxx-client/couchbase/security_options.hxx +15 -0
  72. package/deps/couchbase-cxx-client/couchbase/update_bucket_options.hxx +41 -0
  73. package/deps/couchbase-cxx-client/couchbase/watch_query_indexes_options.hxx +0 -31
  74. package/deps/couchbase-cxx-client/docs/cbc-analytics.md +1 -0
  75. package/deps/couchbase-cxx-client/docs/cbc-get.md +1 -0
  76. package/deps/couchbase-cxx-client/docs/cbc-pillowfight.md +1 -0
  77. package/deps/couchbase-cxx-client/docs/cbc-query.md +1 -0
  78. package/deps/couchbase-cxx-client/docs/cbc.md +10 -0
  79. package/deps/couchbase-cxx-client/test/CMakeLists.txt +1 -0
  80. package/deps/couchbase-cxx-client/test/test_integration_collections.cxx +6 -0
  81. package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +5 -0
  82. package/deps/couchbase-cxx-client/test/test_integration_examples.cxx +137 -1
  83. package/deps/couchbase-cxx-client/test/test_integration_management.cxx +709 -266
  84. package/deps/couchbase-cxx-client/test/test_integration_query.cxx +19 -7
  85. package/deps/couchbase-cxx-client/test/test_integration_range_scan.cxx +351 -112
  86. package/deps/couchbase-cxx-client/test/test_integration_search.cxx +10 -1
  87. package/deps/couchbase-cxx-client/test/test_transaction_public_async_api.cxx +13 -12
  88. package/deps/couchbase-cxx-client/test/test_transaction_public_blocking_api.cxx +27 -21
  89. package/deps/couchbase-cxx-client/test/test_unit_query.cxx +75 -0
  90. package/deps/couchbase-cxx-client/test/utils/server_version.hxx +5 -0
  91. package/deps/couchbase-cxx-client/test/utils/wait_until.cxx +29 -10
  92. package/deps/couchbase-cxx-client/test/utils/wait_until.hxx +3 -1
  93. package/deps/couchbase-cxx-client/tools/utils.cxx +4 -1
  94. package/dist/binding.d.ts +21 -16
  95. package/dist/binding.js +1 -4
  96. package/dist/bindingutilities.d.ts +6 -1
  97. package/dist/bindingutilities.js +36 -1
  98. package/dist/collection.d.ts +65 -3
  99. package/dist/collection.js +107 -0
  100. package/dist/crudoptypes.d.ts +34 -0
  101. package/dist/crudoptypes.js +18 -1
  102. package/dist/queryexecutor.js +1 -0
  103. package/dist/querytypes.d.ts +7 -0
  104. package/dist/rangeScan.d.ts +107 -0
  105. package/dist/rangeScan.js +91 -0
  106. package/dist/streamablepromises.d.ts +6 -0
  107. package/dist/streamablepromises.js +25 -1
  108. package/package.json +13 -13
  109. package/src/addondata.hpp +1 -0
  110. package/src/binding.cpp +5 -2
  111. package/src/connection.cpp +108 -2
  112. package/src/connection.hpp +1 -0
  113. package/src/constants.cpp +2 -12
  114. package/src/jstocbpp_autogen.hpp +49 -22
  115. package/src/jstocbpp_basic.hpp +2 -8
  116. package/src/mutationtoken.cpp +13 -0
  117. package/src/scan_iterator.cpp +90 -0
  118. package/src/scan_iterator.hpp +30 -0
  119. package/tools/gen-bindings-json.py +9 -8
  120. package/deps/couchbase-cxx-client/core/impl/collection_query_index_manager.cxx +0 -93
@@ -184,6 +184,8 @@ struct origin {
184
184
  return credentials_;
185
185
  }
186
186
 
187
+ [[nodiscard]] auto to_json() const -> std::string;
188
+
187
189
  private:
188
190
  couchbase::core::cluster_options options_{};
189
191
  cluster_credentials credentials_{};
@@ -189,10 +189,10 @@ map_status_code(protocol::client_opcode opcode, std::uint16_t status)
189
189
  case key_value_status_code::opaque_no_match:
190
190
 
191
191
  case key_value_status_code::range_scan_cancelled:
192
- return errc::key_value::range_scan_cancelled;
192
+ return errc::common::request_canceled;
193
193
 
194
194
  case key_value_status_code::range_scan_vb_uuid_not_equal:
195
- return errc::key_value::range_scan_vb_uuid_not_equal;
195
+ return errc::key_value::mutation_token_outdated;
196
196
 
197
197
  case key_value_status_code::unknown:
198
198
  break;
@@ -19,34 +19,10 @@
19
19
 
20
20
  namespace couchbase::core
21
21
  {
22
- range_scan::range_scan(scan_term start, scan_term end)
23
- : start_{ std::move(start) }
24
- , end_{ std::move(end) }
25
- {
26
- }
27
-
28
- range_scan::range_scan(std::string_view start, std::string_view end)
29
- : start_{ utils::to_binary(start) }
30
- , end_{ utils::to_binary(end) }
31
- {
32
- }
33
-
34
- range_scan::range_scan(std::string_view start, bool exclusive_start, std::string_view end, bool exclusive_end)
35
- : start_{ utils::to_binary(start), exclusive_start }
36
- , end_{ utils::to_binary(end), exclusive_end }
37
- {
38
- }
39
-
40
- range_scan::range_scan(std::vector<std::byte> start, std::vector<std::byte> end)
41
- : start_{ std::move(start) }
42
- , end_{ std::move(end) }
43
- {
44
- }
45
-
46
- range_scan::range_scan(std::vector<std::byte> start, bool exclusive_start, std::vector<std::byte> end, bool exclusive_end)
47
- : start_{ std::move(start), exclusive_start }
48
- , end_{ std::move(end), exclusive_end }
22
+ auto
23
+ prefix_scan::to_range_scan() const -> range_scan
49
24
  {
25
+ return { scan_term{ prefix, false }, scan_term{ prefix + "\xf4\x8f\xfb\xfb" } };
50
26
  }
51
27
 
52
28
  auto
@@ -29,28 +29,24 @@
29
29
  namespace couchbase::core
30
30
  {
31
31
  struct scan_term {
32
- static constexpr std::byte minimum_marker{ 0x00 };
33
- static constexpr std::byte maximum_marker{ 0xff };
34
-
35
- std::vector<std::byte> id;
32
+ std::string term;
36
33
  bool exclusive{ false };
37
34
  };
38
35
 
39
36
  struct range_scan {
40
- range_scan() = default;
41
- range_scan(scan_term start, scan_term end);
42
- range_scan(std::string_view start, std::string_view end);
43
- range_scan(std::string_view start, bool exclusive_start, std::string_view end, bool exclusive_end);
44
- range_scan(std::vector<std::byte> start, std::vector<std::byte> end);
45
- range_scan(std::vector<std::byte> start, bool exclusive_start, std::vector<std::byte> end, bool exclusive_end);
46
-
47
- scan_term start_{ { scan_term::minimum_marker } };
48
- scan_term end_{ { scan_term::maximum_marker } };
37
+ std::optional<scan_term> from{};
38
+ std::optional<scan_term> to{};
39
+ };
40
+
41
+ struct prefix_scan {
42
+ std::string prefix{};
43
+
44
+ [[nodiscard]] auto to_range_scan() const -> range_scan;
49
45
  };
50
46
 
51
47
  struct sampling_scan {
52
48
  std::size_t limit{};
53
- std::optional<std::uint32_t> seed{};
49
+ std::optional<std::uint64_t> seed{};
54
50
  };
55
51
 
56
52
  struct range_snapshot_requirements {
@@ -62,7 +58,7 @@ struct range_snapshot_requirements {
62
58
  struct range_scan_create_options {
63
59
  std::string scope_name{};
64
60
  std::string collection_name{};
65
- std::variant<std::monostate, range_scan, sampling_scan> scan_type{};
61
+ std::variant<std::monostate, range_scan, prefix_scan, sampling_scan> scan_type{};
66
62
  std::chrono::milliseconds timeout{};
67
63
  std::uint32_t collection_id{ 0 };
68
64
  std::optional<range_snapshot_requirements> snapshot_requirements{};
@@ -88,10 +84,10 @@ struct range_scan_continue_options {
88
84
 
89
85
  std::uint32_t batch_item_limit{ default_batch_item_limit };
90
86
  std::uint32_t batch_byte_limit{ default_batch_byte_limit };
87
+ std::chrono::milliseconds timeout{};
91
88
  std::chrono::milliseconds batch_time_limit{ default_batch_time_limit };
92
89
  std::shared_ptr<couchbase::retry_strategy> retry_strategy{ nullptr };
93
90
 
94
- bool ids_only{ false }; // support servers before MB-54267. TODO: remove after server GA
95
91
  struct {
96
92
  std::string user{};
97
93
  } internal{};
@@ -126,7 +122,7 @@ struct range_scan_item_body {
126
122
  };
127
123
 
128
124
  struct range_scan_item {
129
- std::vector<std::byte> key{};
125
+ std::string key{};
130
126
  std::optional<range_scan_item_body> body{};
131
127
  };
132
128