couchbase 4.2.3 → 4.2.5-dev.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.
- package/CMakeLists.txt +136 -11
- package/deps/couchbase-cxx-client/CMakeLists.txt +54 -4
- package/deps/couchbase-cxx-client/README.md +1 -0
- package/deps/couchbase-cxx-client/bin/create-search-index +164 -0
- package/deps/couchbase-cxx-client/bin/init-cluster +55 -10
- package/deps/couchbase-cxx-client/bin/run-unit-tests +62 -6
- package/deps/couchbase-cxx-client/bin/travel-sample-index-v6.json +184 -0
- package/deps/couchbase-cxx-client/bin/travel-sample-index.json +188 -0
- package/deps/couchbase-cxx-client/cmake/Documentation.cmake +0 -1
- package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +98 -3
- package/deps/couchbase-cxx-client/cmake/Testing.cmake +8 -0
- package/deps/couchbase-cxx-client/cmake/build_config.hxx.in +3 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +183 -152
- package/deps/couchbase-cxx-client/core/bucket.hxx +17 -4
- package/deps/couchbase-cxx-client/core/cluster.hxx +18 -1
- package/deps/couchbase-cxx-client/core/cluster_options.hxx +1 -0
- package/deps/couchbase-cxx-client/core/error_context/key_value.cxx +2 -1
- package/deps/couchbase-cxx-client/core/error_context/key_value.hxx +10 -12
- package/deps/couchbase-cxx-client/core/error_context/search.hxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/boolean_field_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/boolean_query.cxx +62 -0
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/conjunction_query.cxx +51 -0
- package/deps/couchbase-cxx-client/core/impl/date_range.cxx +89 -0
- package/deps/couchbase-cxx-client/core/impl/date_range_facet.cxx +54 -0
- package/deps/couchbase-cxx-client/core/impl/date_range_facet_result.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/date_range_query.cxx +125 -0
- package/deps/couchbase-cxx-client/core/impl/disjunction_query.cxx +51 -0
- package/deps/couchbase-cxx-client/core/impl/encoded_search_facet.hxx +29 -0
- package/deps/couchbase-cxx-client/core/impl/encoded_search_query.hxx +29 -0
- package/deps/couchbase-cxx-client/core/impl/encoded_search_sort.hxx +29 -0
- package/deps/couchbase-cxx-client/core/impl/geo_bounding_box_query.cxx +46 -0
- package/deps/couchbase-cxx-client/core/impl/geo_distance_query.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/geo_polygon_query.cxx +46 -0
- package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.cxx +80 -0
- package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.hxx +48 -0
- package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.cxx +80 -0
- package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.hxx +48 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.cxx +141 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.hxx +61 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.cxx +60 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.hxx +41 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_result.cxx +84 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_result.hxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row.cxx +82 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row.hxx +56 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row_location.hxx +32 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.cxx +137 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.hxx +45 -0
- package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.cxx +80 -0
- package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.hxx +48 -0
- package/deps/couchbase-cxx-client/core/impl/key_value_error_context.cxx +98 -0
- package/deps/couchbase-cxx-client/core/impl/match_all_query.cxx +35 -0
- package/deps/couchbase-cxx-client/core/impl/match_none_query.cxx +35 -0
- package/deps/couchbase-cxx-client/core/impl/match_phrase_query.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/match_query.cxx +59 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range.cxx +49 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range_facet.cxx +54 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range_facet_result.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range_query.cxx +56 -0
- package/deps/couchbase-cxx-client/core/impl/phrase_query.cxx +42 -0
- package/deps/couchbase-cxx-client/core/impl/prefix_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/query_error_context.cxx +75 -0
- package/deps/couchbase-cxx-client/core/impl/query_string_query.cxx +37 -0
- package/deps/couchbase-cxx-client/core/impl/regexp_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/search.cxx +191 -0
- package/deps/couchbase-cxx-client/core/impl/search_error_context.cxx +147 -0
- package/deps/couchbase-cxx-client/core/impl/search_meta_data.cxx +46 -0
- package/deps/couchbase-cxx-client/core/impl/search_result.cxx +66 -0
- package/deps/couchbase-cxx-client/core/impl/search_row.cxx +74 -0
- package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/search_row_locations.cxx +66 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_field.cxx +104 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_id.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_score.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/term_facet.cxx +36 -0
- package/deps/couchbase-cxx-client/core/impl/term_facet_result.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/term_query.cxx +56 -0
- package/deps/couchbase-cxx-client/core/impl/term_range_query.cxx +57 -0
- package/deps/couchbase-cxx-client/core/impl/wildcard_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +9 -2
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +54 -37
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +4 -3
- package/deps/couchbase-cxx-client/core/json_string.hxx +5 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +18 -4
- package/deps/couchbase-cxx-client/core/mozilla_ca_bundle.hxx +39 -0
- package/deps/couchbase-cxx-client/core/operations/document_search.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -1
- package/deps/couchbase-cxx-client/core/protocol/client_request.hxx +11 -2
- package/deps/couchbase-cxx-client/core/protocol/client_response.hxx +1 -0
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +59 -46
- package/deps/couchbase-cxx-client/core/utils/connection_string.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/analytics_error_context.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/boolean_field_query.hxx +77 -0
- package/deps/couchbase-cxx-client/couchbase/boolean_query.hxx +223 -0
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +39 -0
- package/deps/couchbase-cxx-client/couchbase/conjunction_query.hxx +88 -0
- package/deps/couchbase-cxx-client/couchbase/date_range.hxx +69 -0
- package/deps/couchbase-cxx-client/couchbase/date_range_facet.hxx +56 -0
- package/deps/couchbase-cxx-client/couchbase/date_range_facet_result.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/date_range_query.hxx +265 -0
- package/deps/couchbase-cxx-client/couchbase/disjunction_query.hxx +109 -0
- package/deps/couchbase-cxx-client/couchbase/doc_id_query.hxx +111 -0
- package/deps/couchbase-cxx-client/couchbase/error_context.hxx +17 -8
- package/deps/couchbase-cxx-client/couchbase/fmt/analytics_scan_consistency.hxx +52 -0
- package/deps/couchbase-cxx-client/{core/topology/error_map_fmt.hxx → couchbase/fmt/key_value_error_map_attribute.hxx} +21 -21
- package/deps/couchbase-cxx-client/couchbase/fmt/search_scan_consistency.hxx +49 -0
- package/deps/couchbase-cxx-client/couchbase/geo_bounding_box_query.hxx +107 -0
- package/deps/couchbase-cxx-client/couchbase/geo_distance_query.hxx +109 -0
- package/deps/couchbase-cxx-client/couchbase/geo_point.hxx +32 -0
- package/deps/couchbase-cxx-client/couchbase/geo_polygon_query.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/highlight_style.hxx +45 -0
- package/deps/couchbase-cxx-client/couchbase/key_value_error_context.hxx +7 -2
- package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/match_all_query.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/match_none_query.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/match_operator.hxx +45 -0
- package/deps/couchbase-cxx-client/couchbase/match_phrase_query.hxx +108 -0
- package/deps/couchbase-cxx-client/couchbase/match_query.hxx +163 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range.hxx +58 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range_facet.hxx +56 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range_facet_result.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range_query.hxx +143 -0
- package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +93 -0
- package/deps/couchbase-cxx-client/couchbase/prefix_query.hxx +82 -0
- package/deps/couchbase-cxx-client/couchbase/query_error_context.hxx +3 -1
- package/deps/couchbase-cxx-client/couchbase/query_string_query.hxx +72 -0
- package/deps/couchbase-cxx-client/couchbase/regexp_query.hxx +82 -0
- package/deps/couchbase-cxx-client/couchbase/scope.hxx +39 -0
- package/deps/couchbase-cxx-client/couchbase/search_date_range.hxx +68 -0
- package/deps/couchbase-cxx-client/couchbase/search_error_context.hxx +138 -0
- package/deps/couchbase-cxx-client/couchbase/search_facet.hxx +60 -0
- package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +50 -0
- package/deps/couchbase-cxx-client/couchbase/search_meta_data.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/search_metrics.hxx +127 -0
- package/deps/couchbase-cxx-client/couchbase/search_numeric_range.hxx +69 -0
- package/deps/couchbase-cxx-client/couchbase/search_options.hxx +509 -0
- package/deps/couchbase-cxx-client/couchbase/search_query.hxx +69 -0
- package/deps/couchbase-cxx-client/couchbase/search_result.hxx +77 -0
- package/deps/couchbase-cxx-client/couchbase/search_row.hxx +104 -0
- package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/search_row_locations.hxx +86 -0
- package/deps/couchbase-cxx-client/couchbase/search_scan_consistency.hxx +34 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort.hxx +58 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field.hxx +117 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field_missing.hxx +26 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field_mode.hxx +27 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field_type.hxx +28 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_id.hxx +60 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_score.hxx +60 -0
- package/deps/couchbase-cxx-client/couchbase/search_term_range.hxx +51 -0
- package/deps/couchbase-cxx-client/couchbase/security_options.hxx +3 -0
- package/deps/couchbase-cxx-client/couchbase/subdocument_error_context.hxx +4 -2
- package/deps/couchbase-cxx-client/couchbase/term_facet.hxx +48 -0
- package/deps/couchbase-cxx-client/couchbase/term_facet_result.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/term_query.hxx +151 -0
- package/deps/couchbase-cxx-client/couchbase/term_range_query.hxx +142 -0
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_result.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/transactions.hxx +3 -3
- package/deps/couchbase-cxx-client/couchbase/wildcard_query.hxx +83 -0
- package/deps/couchbase-cxx-client/docs/Doxyfile.in +1 -1
- package/deps/couchbase-cxx-client/docs/cbc-analytics.md +2 -2
- package/deps/couchbase-cxx-client/docs/cbc-get.md +3 -2
- package/deps/couchbase-cxx-client/docs/cbc-pillowfight.md +7 -2
- package/deps/couchbase-cxx-client/docs/cbc-query.md +2 -2
- package/deps/couchbase-cxx-client/docs/cbc.md +3 -3
- package/deps/couchbase-cxx-client/docs/cli.hxx +5 -5
- package/deps/couchbase-cxx-client/docs/mainpage.hxx +42 -5
- package/deps/couchbase-cxx-client/test/CMakeLists.txt +1 -0
- package/deps/couchbase-cxx-client/test/test_integration_analytics.cxx +28 -6
- package/deps/couchbase-cxx-client/test/test_integration_collections.cxx +7 -3
- package/deps/couchbase-cxx-client/test/test_integration_connect.cxx +7 -3
- package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +13 -3
- package/deps/couchbase-cxx-client/test/test_integration_diagnostics.cxx +8 -2
- package/deps/couchbase-cxx-client/test/test_integration_durability.cxx +12 -7
- package/deps/couchbase-cxx-client/test/test_integration_examples.cxx +283 -11
- package/deps/couchbase-cxx-client/test/test_integration_management.cxx +140 -88
- package/deps/couchbase-cxx-client/test/test_integration_query.cxx +67 -9
- package/deps/couchbase-cxx-client/test/test_integration_range_scan.cxx +12 -12
- package/deps/couchbase-cxx-client/test/test_integration_read_replica.cxx +48 -11
- package/deps/couchbase-cxx-client/test/test_integration_search.cxx +19 -1
- package/deps/couchbase-cxx-client/test/test_integration_subdoc.cxx +60 -9
- package/deps/couchbase-cxx-client/test/test_integration_tracer.cxx +3 -0
- package/deps/couchbase-cxx-client/test/test_integration_transcoders.cxx +4 -0
- package/deps/couchbase-cxx-client/test/test_transaction_examples.cxx +100 -85
- package/deps/couchbase-cxx-client/test/test_unit_connection_string.cxx +29 -0
- package/deps/couchbase-cxx-client/test/test_unit_search.cxx +427 -0
- package/deps/couchbase-cxx-client/test/utils/integration_test_guard.cxx +2 -1
- package/deps/couchbase-cxx-client/test/utils/logger.cxx +3 -1
- package/deps/couchbase-cxx-client/test/utils/server_version.hxx +31 -15
- package/deps/couchbase-cxx-client/test/utils/test_context.cxx +8 -0
- package/deps/couchbase-cxx-client/tools/get.cxx +9 -8
- package/deps/couchbase-cxx-client/tools/pillowfight.cxx +175 -75
- package/deps/couchbase-cxx-client/tools/version.cxx +4 -2
- package/dist/binding.d.ts +1 -1
- package/dist/binding.js +3 -2
- package/package.json +96 -1
- package/scripts/createPlatformPackages.js +108 -0
- package/scripts/install.js +45 -0
- package/scripts/prebuilds.js +249 -0
- package/scripts/prune.js +124 -0
- package/src/jstocbpp_autogen.hpp +3 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# cbc-pillowfight -
|
|
1
|
+
# cbc-pillowfight - Simple Workload Generator {#cbc-pillowfight}
|
|
2
2
|
|
|
3
3
|
### NAME
|
|
4
4
|
|
|
@@ -17,9 +17,12 @@ Run simple workload generator that sends GET/UPSERT requests with optional N1QL
|
|
|
17
17
|
|
|
18
18
|
<dl>
|
|
19
19
|
<dt>`-h|--help`</dt><dd>Show this screen.</dd>
|
|
20
|
+
<dt>`--verbose`</dt><dd>Include more context and information where it is applicable.</dd>
|
|
20
21
|
<dt>`--bucket-name=STRING`</dt><dd>Name of the bucket. [default: `default`]</dd>
|
|
21
22
|
<dt>`--scope-name=STRING`</dt><dd>Name of the scope. [default: `_default`]</dd>
|
|
22
23
|
<dt>`--collection-name=STRING`</dt><dd>Name of the collection. [default: `_default`]</dd>
|
|
24
|
+
<dt>`--batch-size=INTEGER`</dt><dd>Number of the operations in single batch. [default: `100`]</dd>
|
|
25
|
+
<dt>`--batch-wait=DURATION`</dt><dd>Time to wait after the batch. [default: `0ms`]</dd>
|
|
23
26
|
<dt>`--number-of-io-threads=INTEGER`</dt><dd>Number of the IO threads. [default: `1`]</dd>
|
|
24
27
|
<dt>`--number-of-worker-threads=INTEGER`</dt><dd>Number of the IO threads. [default: `1`]</dd>
|
|
25
28
|
<dt>`--chance-of-get=FLOAT`</dt><dd>The probability of get operation (where 1 means only get, and 0 - only upsert). [default: `0.6`]</dd>
|
|
@@ -29,7 +32,9 @@ Run simple workload generator that sends GET/UPSERT requests with optional N1QL
|
|
|
29
32
|
<dt>`--query-statement=STRING`</dt><dd>The N1QL query statement to use ({bucket_name}, {scope_name} and {collection_name} will be substituted). [default: <code>SELECT COUNT(*) FROM \`{bucket_name}\` WHERE type = "fake_profile"</code>]</dd>
|
|
30
33
|
<dt>`--incompressible-body`</dt><dd>Use random characters to fill generated document value (by default uses 'x' to fill the body).</dd>
|
|
31
34
|
<dt>`--document-body-size=INTEGER`</dt><dd>Size of the body (if zero, it will use predefined document). [default: `0`]</dd>
|
|
35
|
+
<dt>`--number-of-keys-to-populate=INTEGER`</dt><dd>Preload keys before running workload, so that the worker will not generate new keys afterwards. [default: `1000`]</dd>
|
|
32
36
|
<dt>`--operations-limit=INTEGER`</dt><dd>Stop and exit after the number of the operations reaches this limit. (zero for running indefinitely) [default: `0`]</dd>
|
|
37
|
+
|
|
33
38
|
</dl>
|
|
34
39
|
|
|
35
40
|
|
|
@@ -160,4 +165,4 @@ Run simple workload generator that sends GET/UPSERT requests with optional N1QL
|
|
|
160
165
|
|
|
161
166
|
### SEE ALSO
|
|
162
167
|
|
|
163
|
-
[cbc](
|
|
168
|
+
[cbc](md_docs_2cbc).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# cbc-query -
|
|
1
|
+
# cbc-query - Execute N1QL Query {#cbc-query}
|
|
2
2
|
|
|
3
3
|
### NAME
|
|
4
4
|
|
|
@@ -176,4 +176,4 @@ Execute one or more N1QL queries and print results to standard output.
|
|
|
176
176
|
|
|
177
177
|
### SEE ALSO
|
|
178
178
|
|
|
179
|
-
[cbc](
|
|
179
|
+
[cbc](md_docs_2cbc), [cbc-get](md_docs_2cbc-get).
|
|
@@ -25,12 +25,12 @@ Display version information.
|
|
|
25
25
|
|
|
26
26
|
<dt>get</dt>
|
|
27
27
|
<dd>
|
|
28
|
-
Retrieve document from the server. See [cbc-get](
|
|
28
|
+
Retrieve document from the server. See [cbc-get](md_docs_2cbc-get) for more information.
|
|
29
29
|
</dd>
|
|
30
30
|
|
|
31
31
|
<dt>query</dt>
|
|
32
32
|
<dd>
|
|
33
|
-
Perform N1QL query. See [cbc-query](
|
|
33
|
+
Perform N1QL query. See [cbc-query](md_docs_2cbc-query) for more information.
|
|
34
34
|
</dd>
|
|
35
35
|
</dl>
|
|
36
36
|
|
|
@@ -43,4 +43,4 @@ Perform N1QL query. See [cbc-query](#cbc-query) for more information.
|
|
|
43
43
|
|
|
44
44
|
### SEE ALSO
|
|
45
45
|
|
|
46
|
-
[cbc-get](
|
|
46
|
+
[cbc-get](md_docs_2cbc-get), [cbc-query](md_docs_2cbc-query).
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
* @page cli Command Line Tools
|
|
22
22
|
* @brief Indexes of the API grouped by stability.
|
|
23
23
|
*
|
|
24
|
-
* @subpage
|
|
24
|
+
* @subpage md_docs_2cbc
|
|
25
25
|
*
|
|
26
|
-
* @subpage
|
|
26
|
+
* @subpage md_docs_2cbc-get
|
|
27
27
|
*
|
|
28
|
-
* @subpage
|
|
28
|
+
* @subpage md_docs_2cbc-query
|
|
29
29
|
*
|
|
30
|
-
* @subpage
|
|
30
|
+
* @subpage md_docs_2cbc-analytics
|
|
31
31
|
*
|
|
32
|
-
* @subpage
|
|
32
|
+
* @subpage md_docs_2cbc-pillowfight
|
|
33
33
|
*/
|
|
@@ -22,15 +22,52 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @note You may read about related Couchbase software at https://docs.couchbase.com/
|
|
24
24
|
*
|
|
25
|
+
* @anchor start-using
|
|
25
26
|
* ### Start Using
|
|
26
27
|
*
|
|
27
28
|
* The following example shows the most basic usage of the library. It performs the following operations:
|
|
28
|
-
* * connect to local cluster (location and credentials given in program arguments),
|
|
29
|
-
* *
|
|
30
|
-
* *
|
|
29
|
+
* * [1] connect to local cluster (location and credentials given in program arguments),
|
|
30
|
+
* * [2] persists document to the collection using @ref couchbase::collection#upsert(),
|
|
31
|
+
* * [3] retrieves document back with @ref couchbase::collection#get(), extracts content as generic JSON
|
|
31
32
|
* value, and prints one of the fields,
|
|
32
|
-
* *
|
|
33
|
-
* *
|
|
33
|
+
* * [4] performs N1QL query with @ref couchbase::scope#query() and prints the result.
|
|
34
|
+
* * [5] closes the cluster and deallocate resources
|
|
34
35
|
*
|
|
35
36
|
* @snippetlineno test_integration_examples.cxx start-using
|
|
37
|
+
*
|
|
38
|
+
* @anchor start-transactions
|
|
39
|
+
* ### Using Transactions
|
|
40
|
+
*
|
|
41
|
+
* Next example shows transactions API. Read more details in @ref couchbase::transactions::transactions
|
|
42
|
+
*
|
|
43
|
+
* * [1] connect to cluster using the given connection string and the options
|
|
44
|
+
* * [2] persist three documents to the default collection of bucket "default"
|
|
45
|
+
* * [3] blocking transaction
|
|
46
|
+
* * [3.1] closure argument to @ref couchbase::transactions::transactions::run method encapsulates logic, that has to be run in
|
|
47
|
+
* transaction
|
|
48
|
+
* * [3.2] get document
|
|
49
|
+
* * [3.4] replace document's content
|
|
50
|
+
* * [3.5] check the overall status of the transaction
|
|
51
|
+
* * [4] asynchronous transaction
|
|
52
|
+
* * [4.1] create promise to retrieve result from the transaction
|
|
53
|
+
* * [4.2] closure argument to @ref couchbase::transactions::transactions::run method encapsulates logic, that has to be run in
|
|
54
|
+
* transaction
|
|
55
|
+
* * [4.3] get document
|
|
56
|
+
* * [4.4] replace document's content
|
|
57
|
+
* * [4.5] second closure argument to @ref couchbase::transactions::transactions::run represents transaction completion logic
|
|
58
|
+
* * [5] close cluster connection
|
|
59
|
+
*
|
|
60
|
+
* @snippetlineno test_transaction_examples.cxx blocking-txn
|
|
61
|
+
*
|
|
62
|
+
* See also simple class that implements an operation in fictional game backend: @ref game_server.cxx (and its asynchronous version in @ref
|
|
63
|
+
* async_game_server.cxx)
|
|
64
|
+
*
|
|
65
|
+
* @example minimal.cxx - minimal example of SDK, stores single document into the collection.
|
|
66
|
+
*
|
|
67
|
+
* @example game_server.cxx - more complicated example of using transactions (synchronous version).
|
|
68
|
+
*
|
|
69
|
+
* @example async_game_server.cxx - asynchronous version of the game_server.cxx.
|
|
70
|
+
*
|
|
71
|
+
* @example distributed_mutex.cxx - example of distributed mutex object, that backed by a document inside collection.
|
|
72
|
+
*
|
|
36
73
|
*/
|
|
@@ -24,8 +24,12 @@ TEST_CASE("integration: analytics query")
|
|
|
24
24
|
{
|
|
25
25
|
test::utils::integration_test_guard integration;
|
|
26
26
|
|
|
27
|
+
if (integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
28
|
+
SKIP("elixir deployment does not support analytics");
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
if (!integration.cluster_version().supports_analytics()) {
|
|
28
|
-
|
|
32
|
+
SKIP("cluster does not support analytics");
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
@@ -180,8 +184,15 @@ TEST_CASE("integration: analytics scope query")
|
|
|
180
184
|
{
|
|
181
185
|
test::utils::integration_test_guard integration;
|
|
182
186
|
|
|
183
|
-
if (
|
|
184
|
-
|
|
187
|
+
if (integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
188
|
+
SKIP("elixir deployment does not support analytics");
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (!integration.cluster_version().supports_analytics()) {
|
|
192
|
+
SKIP("cluster does not support analytics");
|
|
193
|
+
}
|
|
194
|
+
if (!integration.cluster_version().supports_collections()) {
|
|
195
|
+
SKIP("cluster does not support collections");
|
|
185
196
|
}
|
|
186
197
|
|
|
187
198
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
@@ -286,8 +297,12 @@ TEST_CASE("integration: public API analytics query")
|
|
|
286
297
|
{
|
|
287
298
|
test::utils::integration_test_guard integration;
|
|
288
299
|
|
|
300
|
+
if (integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
301
|
+
SKIP("elixir deployment does not support analytics");
|
|
302
|
+
}
|
|
303
|
+
|
|
289
304
|
if (!integration.cluster_version().supports_analytics()) {
|
|
290
|
-
|
|
305
|
+
SKIP("cluster does not support analytics");
|
|
291
306
|
}
|
|
292
307
|
|
|
293
308
|
auto cluster = couchbase::cluster(integration.cluster);
|
|
@@ -468,8 +483,15 @@ TEST_CASE("integration: public API analytics scope query")
|
|
|
468
483
|
{
|
|
469
484
|
test::utils::integration_test_guard integration;
|
|
470
485
|
|
|
471
|
-
if (
|
|
472
|
-
|
|
486
|
+
if (integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
487
|
+
SKIP("elixir deployment does not support analytics");
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
if (!integration.cluster_version().supports_analytics()) {
|
|
491
|
+
SKIP("cluster does not support analytics");
|
|
492
|
+
}
|
|
493
|
+
if (!integration.cluster_version().supports_collections()) {
|
|
494
|
+
SKIP("cluster does not support collections");
|
|
473
495
|
}
|
|
474
496
|
|
|
475
497
|
auto cluster = couchbase::cluster(integration.cluster);
|
|
@@ -25,7 +25,7 @@ TEST_CASE("integration: missing scope and collection", "[integration]")
|
|
|
25
25
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
26
26
|
|
|
27
27
|
if (!integration.cluster_version().supports_collections()) {
|
|
28
|
-
|
|
28
|
+
SKIP("cluster does not support collections");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
SECTION("get missing scope")
|
|
@@ -77,7 +77,7 @@ TEST_CASE("integration: get and insert non default scope and collection", "[inte
|
|
|
77
77
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
78
78
|
|
|
79
79
|
if (!integration.cluster_version().supports_collections()) {
|
|
80
|
-
|
|
80
|
+
SKIP("cluster does not support collections");
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
auto scope_name = test::utils::uniq_id("scope");
|
|
@@ -121,7 +121,7 @@ TEST_CASE("integration: insert into dropped scope", "[integration]")
|
|
|
121
121
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
122
122
|
|
|
123
123
|
if (!integration.cluster_version().supports_collections()) {
|
|
124
|
-
|
|
124
|
+
SKIP("cluster does not support collections");
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
auto scope_name = test::utils::uniq_id("scope");
|
|
@@ -166,6 +166,10 @@ TEST_CASE("integration: insert into dropped scope", "[integration]")
|
|
|
166
166
|
REQUIRE(dropped);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
if (integration.cluster_version().is_mock()) {
|
|
170
|
+
SKIP("GOCAVES does not generate error when inserting into dropped collection. See "
|
|
171
|
+
"https://github.com/couchbaselabs/gocaves/issues/108");
|
|
172
|
+
}
|
|
169
173
|
{
|
|
170
174
|
couchbase::core::operations::upsert_request req{ id, couchbase::core::utils::to_binary(key) };
|
|
171
175
|
auto resp = test::utils::execute(integration.cluster, req);
|
|
@@ -42,9 +42,9 @@ TEST_CASE("integration: connecting with unresponsive first node in bootstrap nod
|
|
|
42
42
|
test::utils::init_logger();
|
|
43
43
|
asio::io_context io{};
|
|
44
44
|
auto ctx = test::utils::test_context::load_from_environment();
|
|
45
|
-
if (ctx.deployment == test::utils::deployment_type::capella) {
|
|
45
|
+
if (ctx.deployment == test::utils::deployment_type::capella || ctx.deployment == test::utils::deployment_type::elixir) {
|
|
46
46
|
// This breaks SRV assumptions (only one host in connection string)
|
|
47
|
-
|
|
47
|
+
SKIP("capella deployment uses single host in the connection string, which assumed to be reachable");
|
|
48
48
|
}
|
|
49
49
|
auto connstr = couchbase::core::utils::parse_connection_string(ctx.connection_string);
|
|
50
50
|
REQUIRE_FALSE(connstr.bootstrap_nodes.empty());
|
|
@@ -125,6 +125,10 @@ TEST_CASE("integration: destroy cluster without waiting for close completion", "
|
|
|
125
125
|
test::utils::init_logger();
|
|
126
126
|
auto ctx = test::utils::test_context::load_from_environment();
|
|
127
127
|
|
|
128
|
+
if (ctx.deployment == test::utils::deployment_type::elixir) {
|
|
129
|
+
SKIP("elixir deployment is incompatible with parts of this test, but it is probably bug in SDK. FIXME");
|
|
130
|
+
}
|
|
131
|
+
|
|
128
132
|
asio::io_context io{};
|
|
129
133
|
|
|
130
134
|
auto cluster = couchbase::core::cluster::create(io);
|
|
@@ -143,7 +147,7 @@ TEST_CASE("integration: destroy cluster without waiting for close completion", "
|
|
|
143
147
|
}
|
|
144
148
|
|
|
145
149
|
// hit Query
|
|
146
|
-
{
|
|
150
|
+
if (ctx.version.supports_query()) {
|
|
147
151
|
couchbase::core::operations::query_request req{ R"(SELECT 42 AS the_answer)" };
|
|
148
152
|
auto resp = test::utils::execute(cluster, req);
|
|
149
153
|
REQUIRE_SUCCESS(resp.ctx.ec);
|
|
@@ -35,6 +35,10 @@ TEST_CASE("integration: switching off mutation token", "[integration]")
|
|
|
35
35
|
opts.enable_mutation_tokens = false;
|
|
36
36
|
test::utils::integration_test_guard integration(opts);
|
|
37
37
|
|
|
38
|
+
if (integration.cluster_version().is_mock()) {
|
|
39
|
+
SKIP("GOCAVES does not allow to switching off mutation tokens. See https://github.com/couchbaselabs/gocaves/issues/100");
|
|
40
|
+
}
|
|
41
|
+
|
|
38
42
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
39
43
|
couchbase::core::document_id id{ integration.ctx.bucket, "_default", "_default", test::utils::uniq_id("foo") };
|
|
40
44
|
|
|
@@ -228,7 +232,8 @@ TEST_CASE("integration: pessimistic locking", "[integration]")
|
|
|
228
232
|
{
|
|
229
233
|
couchbase::core::operations::get_and_lock_request req{ id };
|
|
230
234
|
req.lock_time = lock_time;
|
|
231
|
-
if (integration.ctx.deployment == test::utils::deployment_type::capella
|
|
235
|
+
if (integration.ctx.deployment == test::utils::deployment_type::capella ||
|
|
236
|
+
integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
232
237
|
req.timeout = std::chrono::seconds{ 2 };
|
|
233
238
|
}
|
|
234
239
|
auto resp = test::utils::execute(integration.cluster, req);
|
|
@@ -489,7 +494,7 @@ TEST_CASE("integration: upsert preserve expiry", "[integration]")
|
|
|
489
494
|
test::utils::integration_test_guard integration;
|
|
490
495
|
|
|
491
496
|
if (!integration.cluster_version().supports_preserve_expiry()) {
|
|
492
|
-
|
|
497
|
+
SKIP("cluster does not support preserve expiry");
|
|
493
498
|
}
|
|
494
499
|
|
|
495
500
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
@@ -670,6 +675,10 @@ TEST_CASE("integration: open bucket that does not exist", "[integration]")
|
|
|
670
675
|
{
|
|
671
676
|
test::utils::integration_test_guard integration;
|
|
672
677
|
|
|
678
|
+
if (integration.cluster_version().is_mock()) {
|
|
679
|
+
SKIP("GOCAVES returns not_found (0x01) instead of no_access (0x24). See https://github.com/couchbaselabs/gocaves/issues/102");
|
|
680
|
+
}
|
|
681
|
+
|
|
673
682
|
auto bucket_name = test::utils::uniq_id("missing_bucket");
|
|
674
683
|
|
|
675
684
|
auto barrier = std::make_shared<std::promise<std::error_code>>();
|
|
@@ -814,7 +823,8 @@ TEST_CASE("integration: pessimistic locking with public API", "[integration]")
|
|
|
814
823
|
// it is not allowed to lock the same key twice
|
|
815
824
|
{
|
|
816
825
|
couchbase::get_and_lock_options options{};
|
|
817
|
-
if (integration.ctx.deployment == test::utils::deployment_type::capella
|
|
826
|
+
if (integration.ctx.deployment == test::utils::deployment_type::capella ||
|
|
827
|
+
integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
818
828
|
options.timeout(std::chrono::seconds{ 2 });
|
|
819
829
|
}
|
|
820
830
|
auto [ctx, resp] = collection.get_and_lock(id, lock_time, options).get();
|
|
@@ -321,6 +321,10 @@ TEST_CASE("integration: fetch diagnostics after N1QL query", "[integration]")
|
|
|
321
321
|
{
|
|
322
322
|
test::utils::integration_test_guard integration;
|
|
323
323
|
|
|
324
|
+
if (!integration.cluster_version().supports_query() || integration.ctx.deployment == test::utils::deployment_type::elixir) {
|
|
325
|
+
SKIP("cluster does not support query or cluster level query");
|
|
326
|
+
}
|
|
327
|
+
|
|
324
328
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
325
329
|
{
|
|
326
330
|
couchbase::core::operations::query_request req{ "SELECT 'hello, couchbase' AS greetings" };
|
|
@@ -365,8 +369,10 @@ TEST_CASE("integration: ping", "[integration]")
|
|
|
365
369
|
REQUIRE(res.services.count(couchbase::core::service_type::management) > 0);
|
|
366
370
|
REQUIRE(res.services[couchbase::core::service_type::management].size() > 0);
|
|
367
371
|
|
|
368
|
-
|
|
369
|
-
|
|
372
|
+
if (integration.ctx.deployment != test::utils::deployment_type::elixir) {
|
|
373
|
+
REQUIRE(res.services.count(couchbase::core::service_type::view) > 0);
|
|
374
|
+
REQUIRE(res.services[couchbase::core::service_type::view].size() > 0);
|
|
375
|
+
}
|
|
370
376
|
|
|
371
377
|
REQUIRE(res.services.count(couchbase::core::service_type::query) > 0);
|
|
372
378
|
REQUIRE(res.services[couchbase::core::service_type::query].size() > 0);
|
|
@@ -25,7 +25,7 @@ TEST_CASE("integration: durable operations", "[integration]")
|
|
|
25
25
|
{
|
|
26
26
|
test::utils::integration_test_guard integration;
|
|
27
27
|
if (!integration.cluster_version().supports_enhanced_durability()) {
|
|
28
|
-
|
|
28
|
+
SKIP("cluster does not support enhanced durability");
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
@@ -68,7 +68,7 @@ TEST_CASE("integration: durable operations", "[integration]")
|
|
|
68
68
|
auto resp = test::utils::execute(integration.cluster, req);
|
|
69
69
|
REQUIRE_SUCCESS(resp.ctx.ec());
|
|
70
70
|
REQUIRE(!resp.cas.empty());
|
|
71
|
-
REQUIRE(resp.value == couchbase::core::utils::
|
|
71
|
+
REQUIRE(couchbase::core::utils::json::parse_binary(resp.value) == couchbase::core::utils::json::parse(R"({"foo":"bar","baz":42})"));
|
|
72
72
|
}
|
|
73
73
|
{
|
|
74
74
|
couchbase::core::operations::remove_request req{ id };
|
|
@@ -83,8 +83,13 @@ TEST_CASE("integration: durable operations", "[integration]")
|
|
|
83
83
|
TEST_CASE("integration: legacy durability persist to active and replicate to one", "[integration]")
|
|
84
84
|
{
|
|
85
85
|
test::utils::integration_test_guard integration;
|
|
86
|
-
if (integration.number_of_replicas() == 0
|
|
87
|
-
|
|
86
|
+
if (integration.number_of_replicas() == 0) {
|
|
87
|
+
SKIP("bucket has zero replicas");
|
|
88
|
+
}
|
|
89
|
+
if (integration.number_of_nodes() <= integration.number_of_replicas()) {
|
|
90
|
+
SKIP(fmt::format("number of nodes ({}) is less or equal to number of replicas ({})",
|
|
91
|
+
integration.number_of_nodes(),
|
|
92
|
+
integration.number_of_replicas()));
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
@@ -124,7 +129,7 @@ TEST_CASE("integration: low level legacy durability impossible if number of node
|
|
|
124
129
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
125
130
|
|
|
126
131
|
if (integration.number_of_replicas() == 3) {
|
|
127
|
-
|
|
132
|
+
SKIP("bucket has three replicas configured, so the test will not be applicable");
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
couchbase::core::document_id id{ integration.ctx.bucket, "_default", "_default", test::utils::uniq_id("foo") };
|
|
@@ -159,7 +164,7 @@ TEST_CASE("integration: low level legacy durability persist to active and replic
|
|
|
159
164
|
test::utils::open_bucket(integration.cluster, integration.ctx.bucket);
|
|
160
165
|
|
|
161
166
|
if (integration.number_of_replicas() < 1) {
|
|
162
|
-
|
|
167
|
+
SKIP("bucket does not have replicas configured");
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
couchbase::core::document_id id{ integration.ctx.bucket, "_default", "_default", test::utils::uniq_id("foo") };
|
|
@@ -211,7 +216,7 @@ TEST_CASE("integration: low level legacy durability persist to active and replic
|
|
|
211
216
|
auto resp = test::utils::execute(integration.cluster, req);
|
|
212
217
|
REQUIRE_SUCCESS(resp.ctx.ec());
|
|
213
218
|
REQUIRE(!resp.cas.empty());
|
|
214
|
-
REQUIRE(resp.value == couchbase::core::utils::
|
|
219
|
+
REQUIRE(couchbase::core::utils::json::parse_binary(resp.value) == couchbase::core::utils::json::parse(R"({"foo":"bar","baz":42})"));
|
|
215
220
|
}
|
|
216
221
|
{
|
|
217
222
|
couchbase::core::operations::remove_request_with_legacy_durability req{
|