couchbase 4.4.3 → 4.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/BUILDING.md +182 -0
  2. package/CMakeLists.txt +11 -0
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
  6. package/deps/couchbase-cxx-client/CMakeLists.txt +3 -1
  7. package/deps/couchbase-cxx-client/README.md +2 -2
  8. package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
  9. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
  10. package/deps/couchbase-cxx-client/cmake/Packaging.cmake +174 -11
  11. package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
  12. package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +4 -0
  13. package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
  14. package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +2 -2
  15. package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
  16. package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
  17. package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
  18. package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
  19. package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
  20. package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
  21. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  22. package/deps/couchbase-cxx-client/core/impl/collection.cxx +27 -3
  23. package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
  24. package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
  25. package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
  26. package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
  27. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  28. package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
  29. package/deps/couchbase-cxx-client/core/io/http_command.hxx +2 -2
  30. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
  31. package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
  32. package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
  33. package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
  34. package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
  35. package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
  36. package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
  37. package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
  38. package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
  39. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
  40. package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
  41. package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
  42. package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
  43. package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
  44. package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
  45. package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
  46. package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
  47. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
  48. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
  49. package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
  50. package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
  51. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  52. package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
  53. package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
  54. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
  55. package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
  56. package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
  57. package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
  58. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  59. package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
  60. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
  61. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
  62. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
  63. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
  64. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
  65. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
  66. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
  67. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
  68. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
  69. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
  70. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
  71. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
  72. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
  73. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
  74. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
  75. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
  76. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
  77. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
  78. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
  79. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
  80. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
  81. package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
  82. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
  83. package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
  84. package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
  85. package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
  86. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
  88. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
  91. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
  92. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
  93. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
  94. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
  95. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
  96. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
  97. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
  98. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
  99. package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
  110. package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
  114. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
  115. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
  117. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
  118. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
  119. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
  120. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
  121. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
  122. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
  123. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
  124. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
  125. package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
  127. package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
  129. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
  131. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
  132. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
  134. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
  135. package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
  136. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +41 -41
  137. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +15 -16
  138. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
  139. package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
  140. package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
  141. package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
  142. package/dist/analyticsindexmanager.d.ts +98 -14
  143. package/dist/analyticsindexmanager.js +452 -411
  144. package/dist/binding.d.ts +53 -4
  145. package/dist/bindingutilities.d.ts +26 -1
  146. package/dist/bindingutilities.js +108 -1
  147. package/dist/couchbase.d.ts +3 -1
  148. package/dist/couchbase.js +2 -0
  149. package/dist/rangeScan.d.ts +1 -1
  150. package/dist/rangeScan.js +1 -1
  151. package/dist/transactions.d.ts +34 -3
  152. package/dist/transactions.js +25 -18
  153. package/dist/transcoders.d.ts +68 -0
  154. package/dist/transcoders.js +194 -1
  155. package/dist/usermanager.d.ts +14 -14
  156. package/dist/usermanager.js +178 -228
  157. package/dist/utilities.js +4 -6
  158. package/dist/utilities_internal.js +1 -2
  159. package/package.json +9 -8
  160. package/src/connection.cpp +22 -0
  161. package/src/connection.hpp +12 -0
  162. package/src/connection_autogen.cpp +100 -0
  163. package/src/jstocbpp_autogen.hpp +315 -8
  164. package/src/jstocbpp_transactions.hpp +1 -2
  165. package/tools/gen-bindings-js.js +38 -3
  166. package/tools/gen-bindings-json.py +575 -328
@@ -4,6 +4,7 @@ include(CMakePackageConfigHelpers)
4
4
  install(DIRECTORY ${PROJECT_SOURCE_DIR}/couchbase DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
5
5
  install(FILES LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR})
6
6
 
7
+ set(COUCHBASE_CXX_CLIENT_PKGCONFIG_VERSION "${COUCHBASE_CXX_CLIENT_SEMVER}" CACHE STRING "The version to use in couchbase_cxx_client.pc")
7
8
  configure_file(${PROJECT_SOURCE_DIR}/cmake/couchbase_cxx_client.pc.in
8
9
  ${PROJECT_BINARY_DIR}/packaging/couchbase_cxx_client.pc @ONLY)
9
10
  install(FILES ${PROJECT_BINARY_DIR}/packaging/couchbase_cxx_client.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
@@ -40,9 +41,13 @@ set(COUCHBASE_CXX_CLIENT_MANIFEST "${PROJECT_BINARY_DIR}/packaging/MANIFEST")
40
41
  if(APPLE)
41
42
  find_program(TAR gtar)
42
43
  find_program(SED gsed)
44
+ find_program(XARGS gxargs)
45
+ find_program(CP gcp)
43
46
  else()
44
47
  find_program(TAR tar)
45
48
  find_program(SED sed)
49
+ find_program(XARGS xargs)
50
+ find_program(CP cp)
46
51
  endif()
47
52
 
48
53
  add_custom_command(
@@ -85,12 +90,12 @@ add_custom_command(
85
90
  -DCPM_USE_LOCAL_PACKAGES=OFF -DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=OFF -DCOUCHBASE_CXX_CLIENT_INSTALL=ON
86
91
  -DCOUCHBASE_CXX_RECORD_BUILD_INFO_FOR_TARBALL=ON
87
92
  COMMAND
88
- xargs --arg-file=${COUCHBASE_CXX_TARBALL_THIRD_PARTY_GLOB_FILE} -I {} find
93
+ ${XARGS} --arg-file=${COUCHBASE_CXX_TARBALL_THIRD_PARTY_GLOB_FILE} -I {} find
89
94
  "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/cache" -wholename "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/cache/{}"
90
95
  -type f | grep -v "crypto_test_data\\|googletest" | uniq >
91
96
  "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/third_party_manifest.txt"
92
97
  COMMAND ${CMAKE_COMMAND} -E make_directory "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/filtered_cache"
93
- COMMAND xargs --arg-file="${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/third_party_manifest.txt" -I {} cp --parents {}
98
+ COMMAND ${XARGS} --arg-file="${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/third_party_manifest.txt" -I {} ${CP} --parents {}
94
99
  "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}/tmp/filtered_cache"
95
100
  COMMAND
96
101
  ${CMAKE_COMMAND} -E rename
@@ -107,6 +112,116 @@ add_custom_command(
107
112
 
108
113
  add_custom_target(packaging_tarball DEPENDS ${COUCHBASE_CXX_CLIENT_TARBALL})
109
114
 
115
+ option(COUCHBASE_CXX_CLIENT_DEB_TARGETS "Enable targets for building DEBs" FALSE)
116
+ if(COUCHBASE_CXX_CLIENT_DEB_TARGETS)
117
+ find_program(DPKG_BUILDPACKAGE dpkg-buildpackage REQUIRED) # apt install -y dpkg-dev
118
+ find_program(SUDO sudo REQUIRED) # apt install -y sudo
119
+ find_program(COWBUILDER cowbuilder REQUIRED) # apt install -y cowbuilder
120
+
121
+ string(TIMESTAMP COUCHBASE_CXX_CLIENT_DEB_DATE "%a, %d %b %Y %H:%M:%S %z" UTC)
122
+
123
+ file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/packaging/workspace/debian/source/")
124
+
125
+ set(COUCHBASE_CXX_CLIENT_DEBIAN_CHANGELOG "${PROJECT_BINARY_DIR}/packaging/workspace/debian/changelog")
126
+ configure_file(${PROJECT_SOURCE_DIR}/cmake/debian/changelog.in "${COUCHBASE_CXX_CLIENT_DEBIAN_CHANGELOG}" @ONLY)
127
+
128
+ file(COPY ${PROJECT_SOURCE_DIR}/cmake/debian/compat ${PROJECT_SOURCE_DIR}/cmake/debian/control
129
+ ${PROJECT_SOURCE_DIR}/cmake/debian/rules DESTINATION "${PROJECT_BINARY_DIR}/packaging/workspace/debian/")
130
+ file(COPY ${PROJECT_SOURCE_DIR}/cmake/debian/source/format
131
+ DESTINATION "${PROJECT_BINARY_DIR}/packaging/workspace/debian/source/")
132
+
133
+ set(COUCHBASE_CXX_CLIENT_DEBIAN_ORIG_TARBALL
134
+ "${PROJECT_BINARY_DIR}/packaging/couchbase-cxx-client_${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}.orig.tar.gz")
135
+ add_custom_command(
136
+ OUTPUT ${COUCHBASE_CXX_CLIENT_DEBIAN_ORIG_TARBALL}
137
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging"
138
+ COMMAND ${CMAKE_COMMAND} -E copy "${COUCHBASE_CXX_CLIENT_TARBALL}" "${COUCHBASE_CXX_CLIENT_DEBIAN_ORIG_TARBALL}"
139
+ DEPENDS ${COUCHBASE_CXX_CLIENT_TARBALL})
140
+
141
+ set(COUCHBASE_CXX_CLIENT_DEBIAN_TARBALL_EXTRACTED "${PROJECT_BINARY_DIR}/packaging/tarball_extracted.txt")
142
+ add_custom_command(
143
+ OUTPUT ${COUCHBASE_CXX_CLIENT_DEBIAN_TARBALL_EXTRACTED}
144
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging/workspace"
145
+ COMMAND ${TAR} --strip-components=1 -xf "${COUCHBASE_CXX_CLIENT_TARBALL}"
146
+ COMMAND touch ${COUCHBASE_CXX_CLIENT_DEBIAN_TARBALL_EXTRACTED}
147
+ DEPENDS ${COUCHBASE_CXX_CLIENT_TARBALL})
148
+
149
+ set(COUCHBASE_CXX_CLIENT_DEBIAN_DSC
150
+ "${PROJECT_BINARY_DIR}/packaging/couchbase-cxx-client_${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}-${COUCHBASE_CXX_CLIENT_PACKAGE_RELEASE}.dsc"
151
+ )
152
+ add_custom_command(
153
+ OUTPUT ${COUCHBASE_CXX_CLIENT_DEBIAN_DSC}
154
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging/workspace"
155
+ COMMAND ${DPKG_BUILDPACKAGE} -us -uc
156
+ DEPENDS ${COUCHBASE_CXX_CLIENT_DEBIAN_ORIG_TARBALL} ${COUCHBASE_CXX_CLIENT_DEBIAN_TARBALL_EXTRACTED})
157
+
158
+ function(select_mirror_options distro options)
159
+ if(${distro} STREQUAL "bookworm")
160
+ set(${options}
161
+ --components
162
+ main
163
+ --mirror
164
+ https://ftp.debian.org/debian
165
+ PARENT_SCOPE)
166
+ else()
167
+ if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
168
+ set(${options}
169
+ --components
170
+ "main universe"
171
+ --mirror
172
+ http://ports.ubuntu.com/ubuntu-ports
173
+ PARENT_SCOPE)
174
+ else()
175
+ set(${options}
176
+ --components
177
+ "main universe"
178
+ --mirror
179
+ http://archive.ubuntu.com/ubuntu
180
+ PARENT_SCOPE)
181
+ endif()
182
+ endif()
183
+ endfunction()
184
+
185
+ set(cowbuilder_results "${PROJECT_BINARY_DIR}/packaging/results")
186
+ file(MAKE_DIRECTORY "${cowbuilder_results}")
187
+
188
+ list(
189
+ APPEND
190
+ COUCHBASE_CXX_CLIENT_SUPPORTED_DISTROS
191
+ "jammy"
192
+ "noble"
193
+ "bookworm")
194
+
195
+ set(cowbuilder_root "${PROJECT_BINARY_DIR}/packaging/root.cow")
196
+ set(last_output "")
197
+ foreach(distro ${COUCHBASE_CXX_CLIENT_SUPPORTED_DISTROS})
198
+ select_mirror_options(${distro} mirror_options)
199
+ set(timestamp "${PROJECT_BINARY_DIR}/packaging/${distro}_done.txt")
200
+ set(dependencies ${COUCHBASE_CXX_CLIENT_DEBIAN_DSC})
201
+
202
+ if(last_output)
203
+ list(APPEND dependencies ${last_output})
204
+ endif()
205
+
206
+ add_custom_command(
207
+ COMMENT "Building DEB for ${distro}"
208
+ OUTPUT ${timestamp}
209
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging"
210
+ COMMAND ${SUDO} ${CMAKE_COMMAND} -E rm -rf "${cowbuilder_root}"
211
+ COMMAND ${SUDO} ${COWBUILDER} --create --basepath "${cowbuilder_root}" --distribution ${distro} ${mirror_options}
212
+ COMMAND
213
+ ${SUDO} ${COWBUILDER} --build --basepath "${cowbuilder_root}" --buildresult
214
+ "${cowbuilder_results}/couchbase-cxx-client-${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}-${COUCHBASE_CXX_CLIENT_PACKAGE_RELEASE}.${distro}.${CMAKE_SYSTEM_PROCESSOR}"
215
+ --debbuildopts -j8 --debbuildopts "-us -uc" ${COUCHBASE_CXX_CLIENT_DEBIAN_DSC}
216
+ COMMAND touch ${timestamp}
217
+ DEPENDS ${dependencies})
218
+
219
+ set(last_output ${timestamp})
220
+ endforeach()
221
+
222
+ add_custom_target(packaging_deb DEPENDS ${last_output})
223
+ endif()
224
+
110
225
  option(COUCHBASE_CXX_CLIENT_RPM_TARGETS "Enable targets for building RPMs" FALSE)
111
226
  if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)
112
227
  find_program(MOCK mock REQUIRED) # dnf install -y mock
@@ -132,25 +247,26 @@ if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)
132
247
 
133
248
  add_custom_target(packaging_srpm DEPENDS ${COUCHBASE_CXX_CLIENT_SRPM})
134
249
 
135
- list(APPEND COUCHBASE_CXX_CLIENT_SUPPORTED_ROOTS
250
+ list(
251
+ APPEND
252
+ COUCHBASE_CXX_CLIENT_SUPPORTED_ROOTS
136
253
  "opensuse-leap-15.5-${CMAKE_SYSTEM_PROCESSOR}"
137
254
  "rocky-9-${CMAKE_SYSTEM_PROCESSOR}"
138
255
  "rocky-8-${CMAKE_SYSTEM_PROCESSOR}"
139
256
  "amazonlinux-2023-${CMAKE_SYSTEM_PROCESSOR}"
140
- "fedora-40-${CMAKE_SYSTEM_PROCESSOR}"
141
- )
257
+ "fedora-41-${CMAKE_SYSTEM_PROCESSOR}"
258
+ "fedora-40-${CMAKE_SYSTEM_PROCESSOR}")
142
259
 
143
260
  message(STATUS "Supported build roots for RPM packages: ${COUCHBASE_CXX_CLIENT_SUPPORTED_ROOTS}")
144
261
 
145
- # Build the chain of the dependencies from the timestamps, so that everything
146
- # will be executed one-by-one in order, because the mock cannot run multiple
147
- # roots simultaneously
262
+ # Build the chain of the dependencies from the timestamps, so that everything will be executed one-by-one in order,
263
+ # because the mock cannot run multiple roots simultaneously
148
264
  set(last_output "")
149
265
  foreach(root ${COUCHBASE_CXX_CLIENT_SUPPORTED_ROOTS})
150
266
  set(timestamp "${PROJECT_BINARY_DIR}/packaging/rpm/${root}/done.txt")
151
267
  set(dependencies ${COUCHBASE_CXX_CLIENT_SRPM})
152
268
 
153
- if (last_output)
269
+ if(last_output)
154
270
  list(APPEND dependencies ${last_output})
155
271
  endif()
156
272
 
@@ -158,8 +274,8 @@ if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)
158
274
  COMMENT "Building RPM for ${root}"
159
275
  OUTPUT ${timestamp}
160
276
  WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging"
161
- COMMAND ${MOCK} --rebuild --root=${root}
162
- --resultdir=${PROJECT_BINARY_DIR}/packaging/rpm/${root} "${COUCHBASE_CXX_CLIENT_SRPM}"
277
+ COMMAND ${MOCK} --rebuild --root=${root} --resultdir=${PROJECT_BINARY_DIR}/packaging/rpm/${root}
278
+ "${COUCHBASE_CXX_CLIENT_SRPM}"
163
279
  COMMAND touch ${timestamp}
164
280
  DEPENDS ${dependencies})
165
281
 
@@ -169,3 +285,50 @@ if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)
169
285
  # add target that depends on the last root
170
286
  add_custom_target(packaging_rpm DEPENDS ${last_output})
171
287
  endif()
288
+
289
+ option(COUCHBASE_CXX_CLIENT_APK_TARGETS "Enable targets for building APKs (for Alpine Linux)" FALSE)
290
+ if(COUCHBASE_CXX_CLIENT_APK_TARGETS)
291
+ find_program(ABUILD abuild REQUIRED) # apk add alpine-sdk
292
+
293
+ set(COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE "${COUCHBASE_CXX_CLIENT_TARBALL_NAME}")
294
+ set(COUCHBASE_CXX_CLIENT_TARBALL_ALPINE
295
+ "${PROJECT_BINARY_DIR}/packaging/${COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE}.tar.gz")
296
+ if(${COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS} GREATER 0)
297
+ set(COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE
298
+ "couchbase-cxx-client-${COUCHBASE_CXX_CLIENT_PACKAGE_VERSION}_p${COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS}")
299
+ set(COUCHBASE_CXX_CLIENT_TARBALL_ALPINE
300
+ "${PROJECT_BINARY_DIR}/packaging/${COUCHBASE_CXX_CLIENT_TARBALL_NAME_ALPINE}.tar.gz")
301
+ endif()
302
+
303
+ set(cxxcbc_apkbuild_file "${PROJECT_BINARY_DIR}/packaging/APKBUILD")
304
+ configure_file(${PROJECT_SOURCE_DIR}/cmake/APKBUILD.in "${cxxcbc_apkbuild_file}" @ONLY)
305
+
306
+ if(NOT
307
+ "${COUCHBASE_CXX_CLIENT_TARBALL}"
308
+ STREQUAL
309
+ "${COUCHBASE_CXX_CLIENT_TARBALL_ALPINE}")
310
+ add_custom_command(
311
+ OUTPUT ${COUCHBASE_CXX_CLIENT_TARBALL_ALPINE}
312
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging"
313
+ COMMAND ${CMAKE_COMMAND} -E copy "${COUCHBASE_CXX_CLIENT_TARBALL}" "${COUCHBASE_CXX_CLIENT_TARBALL_ALPINE}"
314
+ DEPENDS ${COUCHBASE_CXX_CLIENT_TARBALL})
315
+ endif()
316
+
317
+ set(cxxcbc_apkbuild_checksum "${PROJECT_BINARY_DIR}/packaging/apk_checksum_updated.txt")
318
+ add_custom_command(
319
+ OUTPUT ${cxxcbc_apkbuild_checksum}
320
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging"
321
+ COMMAND ${ABUILD} checksum
322
+ COMMAND touch ${cxxcbc_apkbuild_checksum}
323
+ DEPENDS ${COUCHBASE_CXX_CLIENT_TARBALL_ALPINE} ${cxxcbc_apkbuild_file})
324
+
325
+ set(cxxcbc_apkbuild_timestamp "${PROJECT_BINARY_DIR}/packaging/apk_timestamp.txt")
326
+ add_custom_command(
327
+ OUTPUT ${cxxcbc_apkbuild_timestamp}
328
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/packaging"
329
+ COMMAND ${ABUILD} -r
330
+ COMMAND touch ${cxxcbc_apkbuild_timestamp}
331
+ DEPENDS ${COUCHBASE_CXX_CLIENT_TARBALL_ALPINE} ${cxxcbc_apkbuild_checksum})
332
+
333
+ add_custom_target(packaging_apk DEPENDS ${cxxcbc_apkbuild_timestamp})
334
+ endif()
@@ -0,0 +1,10 @@
1
+ if(NOT MSVC)
2
+ if(APPLE)
3
+ set(CMAKE_MACOSX_RPATH ON)
4
+ endif()
5
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
6
+ list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
7
+ if("${isSystemDir}" STREQUAL "-1")
8
+ set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
9
+ endif()
10
+ endif()
@@ -58,6 +58,7 @@ string(REGEX REPLACE "T.*" "" COUCHBASE_CXX_CLIENT_BUILD_DATE "${COUCHBASE_CXX_C
58
58
  set(COUCHBASE_CXX_CLIENT_SEMVER "${couchbase_cxx_client_VERSION}")
59
59
  set(COUCHBASE_CXX_CLIENT_PACKAGE_VERSION "${couchbase_cxx_client_VERSION}")
60
60
  set(COUCHBASE_CXX_CLIENT_PACKAGE_RELEASE "${couchbase_cxx_client_BUILD_NUMBER}")
61
+ set(COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS 0)
61
62
  if(COUCHBASE_CXX_CLIENT_GIT_DESCRIBE MATCHES
62
63
  "^([0-9]+\\.[0-9]+\\.[0-9]+)(-([a-zA-Z0-9\\.]+))?(-([0-9]+)-g([a-zA-Z0-9]+))?$")
63
64
  set(COUCHBASE_CXX_CLIENT_SEMVER "${CMAKE_MATCH_1}")
@@ -67,6 +68,7 @@ if(COUCHBASE_CXX_CLIENT_GIT_DESCRIBE MATCHES
67
68
  set(COUCHBASE_CXX_CLIENT_PACKAGE_RELEASE "${CMAKE_MATCH_3}.${couchbase_cxx_client_BUILD_NUMBER}")
68
69
  endif()
69
70
  if(CMAKE_MATCH_5 AND CMAKE_MATCH_5 GREATER 0) # number_of_commits.build_number.sha1
71
+ set(COUCHBASE_CXX_CLIENT_NUMBER_OF_COMMITS ${CMAKE_MATCH_5})
70
72
  set(COUCHBASE_CXX_CLIENT_SEMVER
71
73
  "${COUCHBASE_CXX_CLIENT_SEMVER}+${CMAKE_MATCH_5}.${couchbase_cxx_client_BUILD_NUMBER}.${CMAKE_MATCH_6}")
72
74
  if(CMAKE_MATCH_3) # pre-release
@@ -78,6 +80,8 @@ if(COUCHBASE_CXX_CLIENT_GIT_DESCRIBE MATCHES
78
80
  endif()
79
81
  endif()
80
82
 
83
+ set(COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID "" CACHE STRING "Unified ID for wrapper SDK formatted as '<name>/<version>'")
84
+
81
85
  configure_file(${PROJECT_SOURCE_DIR}/cmake/build_version.hxx.in
82
86
  ${PROJECT_BINARY_DIR}/generated/couchbase/build_version.hxx @ONLY)
83
87
  configure_file(${PROJECT_SOURCE_DIR}/cmake/build_config.hxx.in
@@ -32,5 +32,6 @@ constexpr auto COUCHBASE_CXX_CLIENT_VERSION_BUILD = @couchbase_cxx_client_BUILD_
32
32
  constexpr auto COUCHBASE_CXX_CLIENT_GIT_REVISION = "@COUCHBASE_CXX_CLIENT_GIT_REVISION@";
33
33
  constexpr auto COUCHBASE_CXX_CLIENT_GIT_REVISION_SHORT = "@COUCHBASE_CXX_CLIENT_GIT_REVISION_SHORT@";
34
34
  constexpr auto COUCHBASE_CXX_CLIENT_GIT_DESCRIBE = "@COUCHBASE_CXX_CLIENT_GIT_DESCRIBE@";
35
+ constexpr auto COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID = "@COUCHBASE_CXX_CLIENT_WRAPPER_UNIFIED_ID@";
35
36
  #cmakedefine COUCHBASE_CXX_CLIENT_STATIC_STDLIB 1
36
37
  #cmakedefine COUCHBASE_CXX_CLIENT_STATIC_OPENSSL 1
@@ -30,13 +30,13 @@ Source0: @COUCHBASE_CXX_CLIENT_TARBALL_NAME@.tar.gz
30
30
  This is the client and protocol library for Couchbase project.
31
31
 
32
32
  %package tools
33
- Summary: Couchbase C++ SDK - Tools
33
+ Summary: Couchbase C++ SDK, command line tools
34
34
  Requires: %{name}%{?_isa} = %{version}-%{release}
35
35
  %description -n %{name}-tools
36
36
  CLI tools from the Couchbase C++ SDK.
37
37
 
38
38
  %package devel
39
- Summary: Couchbase C++ SDK - Header files
39
+ Summary: Couchbase C++ SDK, development files
40
40
  Requires: %{name}%{?_isa} = %{version}-%{release}
41
41
  %description devel
42
42
  Development files for the Couchbase C++ SDK.
@@ -3,8 +3,8 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@
3
3
  includedir=@CMAKE_INSTALL_PREFIX@/include
4
4
  libdir=@CMAKE_INSTALL_LIBDIR@
5
5
 
6
- Name: couchbase-cxx-client @COUCHBASE_CXX_CLIENT_SEMVER@
6
+ Name: couchbase-cxx-client @COUCHBASE_CXX_CLIENT_PKGCONFIG_VERSION@
7
7
  Description: Couchbase C++ SDK
8
- Version: @COUCHBASE_CXX_CLIENT_SEMVER@
8
+ Version: @COUCHBASE_CXX_CLIENT_PKGCONFIG_VERSION@
9
9
  Libs: -L${libdir} -lcouchbase_cxx_client
10
10
  Cflags: -I${includedir}
@@ -0,0 +1,5 @@
1
+ couchbase-cxx-client (@COUCHBASE_CXX_CLIENT_PACKAGE_VERSION@-@COUCHBASE_CXX_CLIENT_PACKAGE_RELEASE@) unstable; urgency=medium
2
+
3
+ * Automated build.
4
+
5
+ -- Couchbase SDK Team <support@couchbase.com> @COUCHBASE_CXX_CLIENT_DEB_DATE@
@@ -0,0 +1,40 @@
1
+ Source: couchbase-cxx-client
2
+ Section: libs
3
+ Priority: optional
4
+ Maintainer: Couchbase SDK Team <support@couchbase.com>
5
+ Build-Depends: debhelper (>= 9), cmake, pkg-config
6
+ Standards-Version: 4.5.0
7
+ Vcs-Browser: https://github.com/couchbase/couchbase-cxx-client
8
+ Vcs-Git: https://github.com/couchbase/couchbase-cxx-client.git
9
+
10
+ Package: couchbase-cxx-client
11
+ Architecture: any
12
+ Multi-Arch: same
13
+ Depends: ${shlibs:Depends}, ${misc:Depends}
14
+ Description: Couchbase C++ SDK.
15
+ This is the client and protocol library for Couchbase project.
16
+
17
+ Package: couchbase-cxx-client-tools
18
+ Architecture: any
19
+ Multi-Arch: same
20
+ Section: utils
21
+ Depends: couchbase-cxx-client (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
22
+ Description: Couchbase C++ SDK, command line tools.
23
+ This is the command line tools for the client and protocol library for
24
+ Couchbase project.
25
+
26
+ Package: couchbase-cxx-client-dev
27
+ Architecture: any
28
+ Multi-Arch: same
29
+ Depends: couchbase-cxx-client (= ${binary:Version}), ${misc:Depends}
30
+ Description: Couchbase C++ SDK, development files.
31
+ This is the development files for the client and protocol library for
32
+ Couchbase project.
33
+
34
+ Package: couchbase-cxx-client-dbg
35
+ Architecture: any
36
+ Multi-Arch: same
37
+ Depends: couchbase-cxx-client (= ${binary:Version}), ${misc:Depends}
38
+ Description: Couchbase C++ SDK, debug symbols.
39
+ This is the debug symbols for the client and protocol library for Couchbase
40
+ project.
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/make -f
2
+
3
+ %:
4
+ dh $@ --buildsystem=cmake
5
+
6
+ override_dh_strip:
7
+ dh_strip -pcouchbase-cxx-client-tools -pcouchbase-cxx-client --dbg-package=couchbase-cxx-client-dbg
8
+ dh_strip --remaining-packages
9
+
10
+ override_dh_auto_configure:
11
+ echo "usr/include/couchbase" \
12
+ > debian/couchbase-cxx-client-dev.install
13
+ echo "usr/lib/$(DEB_HOST_MULTIARCH)/libcouchbase_cxx_client.so" \
14
+ >> debian/couchbase-cxx-client-dev.install
15
+ echo "usr/lib/$(DEB_HOST_MULTIARCH)/cmake" \
16
+ >> debian/couchbase-cxx-client-dev.install
17
+ echo "usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig" \
18
+ >> debian/couchbase-cxx-client-dev.install
19
+ echo "usr/bin/*" \
20
+ > debian/couchbase-cxx-client-tools.install
21
+ echo "usr/lib/$(DEB_HOST_MULTIARCH)/libcouchbase_cxx_client.so.*" \
22
+ > debian/couchbase-cxx-client.install
23
+ echo "usr/share/doc/tao/json/LICENSE" \
24
+ >> debian/couchbase-cxx-client.install
25
+ echo "usr/share/doc/tao/pegtl/LICENSE" \
26
+ >> debian/couchbase-cxx-client.install
27
+ echo "usr/share/doc/couchbase_cxx_client/LICENSE.txt" \
28
+ >> debian/couchbase-cxx-client.install
29
+ dh_auto_configure -- \
30
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
31
+ -DBUILD_SHARED_LIBS=OFF \
32
+ -DCOUCHBASE_CXX_CLIENT_INSTALL=ON \
33
+ -DCOUCHBASE_CXX_CLIENT_STATIC_BORINGSSL=ON \
34
+ -DCOUCHBASE_CXX_CLIENT_BUILD_EXAMPLES=OFF \
35
+ -DCOUCHBASE_CXX_CLIENT_BUILD_TESTS=OFF \
36
+ -DCOUCHBASE_CXX_CLIENT_BUILD_TOOLS=ON \
37
+ -DCOUCHBASE_CXX_CLIENT_BUILD_STATIC=OFF \
38
+ -DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=ON
39
+
40
+ override_dh_auto_build:
41
+ dh_auto_build
@@ -0,0 +1 @@
1
+ 3.0 (quilt)
@@ -167,6 +167,7 @@ build_analytics_request(std::string statement,
167
167
  std::move(options.client_context_id),
168
168
  options.timeout,
169
169
  };
170
+ request.parent_span = options.parent_span;
170
171
  if (!options.raw.empty()) {
171
172
  for (auto& [name, value] : options.raw) {
172
173
  request.raw[name] = std::move(value);
@@ -149,6 +149,7 @@ public:
149
149
  {},
150
150
  options.timeout,
151
151
  { options.retry_strategy },
152
+ options.parent_span,
152
153
  },
153
154
  [handler = std::move(handler)](auto resp) mutable {
154
155
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -166,6 +167,7 @@ public:
166
167
  false,
167
168
  options.timeout,
168
169
  { options.retry_strategy },
170
+ options.parent_span,
169
171
  },
170
172
  [handler = std::move(handler)](auto resp) mutable {
171
173
  std::optional<std::chrono::system_clock::time_point> expiry_time{};
@@ -190,6 +192,7 @@ public:
190
192
  expiry,
191
193
  options.timeout,
192
194
  { options.retry_strategy },
195
+ options.parent_span,
193
196
  },
194
197
  [handler = std::move(handler)](auto resp) mutable {
195
198
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -210,6 +213,7 @@ public:
210
213
  expiry,
211
214
  options.timeout,
212
215
  { options.retry_strategy },
216
+ options.parent_span,
213
217
  },
214
218
  [handler = std::move(handler)](const auto& resp) mutable {
215
219
  return handler(core::impl::make_error(std::move(resp.ctx)), result{ resp.cas });
@@ -279,6 +283,7 @@ public:
279
283
  options.durability_level,
280
284
  options.timeout,
281
285
  { options.retry_strategy },
286
+ options.parent_span,
282
287
  },
283
288
  [handler = std::move(handler)](auto resp) mutable {
284
289
  if (resp.ctx.ec()) {
@@ -290,7 +295,14 @@ public:
290
295
  }
291
296
 
292
297
  core::operations::remove_request request{
293
- id, {}, {}, options.cas, durability_level::none, options.timeout, { options.retry_strategy },
298
+ id,
299
+ {},
300
+ {},
301
+ options.cas,
302
+ durability_level::none,
303
+ options.timeout,
304
+ { options.retry_strategy },
305
+ options.parent_span,
294
306
  };
295
307
  return core_.execute(std::move(request),
296
308
  [core = core_, id = std::move(id), options, handler = std::move(handler)](
@@ -332,6 +344,7 @@ public:
332
344
  static_cast<uint32_t>(lock_duration.count()),
333
345
  options.timeout,
334
346
  { options.retry_strategy },
347
+ options.parent_span,
335
348
  },
336
349
  [handler = std::move(handler)](auto&& resp) mutable {
337
350
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -352,6 +365,7 @@ public:
352
365
  cas,
353
366
  options.timeout,
354
367
  { options.retry_strategy },
368
+ options.parent_span,
355
369
  },
356
370
  [handler = std::move(handler)](auto&& resp) mutable {
357
371
  return handler(core::impl::make_error(std::move(resp.ctx)));
@@ -369,6 +383,7 @@ public:
369
383
  {},
370
384
  options.timeout,
371
385
  { options.retry_strategy },
386
+ options.parent_span,
372
387
  },
373
388
  [handler = std::move(handler)](auto&& resp) mutable {
374
389
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -395,6 +410,7 @@ public:
395
410
  specs,
396
411
  options.timeout,
397
412
  { options.retry_strategy },
413
+ options.parent_span,
398
414
  },
399
415
  [handler = std::move(handler)](auto resp) mutable {
400
416
  if (resp.ctx.ec()) {
@@ -427,7 +443,7 @@ public:
427
443
  core::document_id{ bucket_name_, scope_name_, name_, std::move(document_key) },
428
444
  specs,
429
445
  options.timeout,
430
- {},
446
+ options.parent_span,
431
447
  options.read_preference,
432
448
  },
433
449
  [handler = std::move(handler)](auto resp) mutable {
@@ -465,7 +481,7 @@ public:
465
481
  core::document_id{ bucket_name_, scope_name_, name_, std::move(document_key) },
466
482
  specs,
467
483
  options.timeout,
468
- {},
484
+ options.parent_span,
469
485
  options.read_preference,
470
486
  },
471
487
  [handler = std::move(handler)](auto resp) mutable {
@@ -514,6 +530,7 @@ public:
514
530
  options.timeout,
515
531
  { options.retry_strategy },
516
532
  options.preserve_expiry,
533
+ options.parent_span,
517
534
  },
518
535
  [handler = std::move(handler)](auto resp) mutable {
519
536
  if (resp.ctx.ec()) {
@@ -548,6 +565,7 @@ public:
548
565
  options.timeout,
549
566
  { options.retry_strategy },
550
567
  options.preserve_expiry,
568
+ options.parent_span,
551
569
  };
552
570
  return core_.execute(
553
571
  std::move(request),
@@ -611,6 +629,7 @@ public:
611
629
  options.timeout,
612
630
  { options.retry_strategy },
613
631
  options.preserve_expiry,
632
+ options.parent_span,
614
633
  },
615
634
  [handler = std::move(handler)](auto resp) mutable {
616
635
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -629,6 +648,7 @@ public:
629
648
  options.timeout,
630
649
  { options.retry_strategy },
631
650
  options.preserve_expiry,
651
+ options.parent_span,
632
652
  };
633
653
  return core_.execute(
634
654
  std::move(request),
@@ -681,6 +701,7 @@ public:
681
701
  options.durability_level,
682
702
  options.timeout,
683
703
  { options.retry_strategy },
704
+ options.parent_span,
684
705
  },
685
706
  [handler = std::move(handler)](auto&& resp) mutable {
686
707
  if (resp.ctx.ec()) {
@@ -701,6 +722,7 @@ public:
701
722
  durability_level::none,
702
723
  options.timeout,
703
724
  { options.retry_strategy },
725
+ options.parent_span,
704
726
  };
705
727
  return core_.execute(
706
728
  std::move(request),
@@ -754,6 +776,7 @@ public:
754
776
  options.timeout,
755
777
  { options.retry_strategy },
756
778
  options.preserve_expiry,
779
+ options.parent_span,
757
780
  },
758
781
  [handler = std::move(handler)](auto resp) mutable {
759
782
  if (resp.ctx.ec()) {
@@ -776,6 +799,7 @@ public:
776
799
  options.timeout,
777
800
  { options.retry_strategy },
778
801
  options.preserve_expiry,
802
+ options.parent_span,
779
803
  };
780
804
  return core_.execute(std::move(request),
781
805
  [core = core_, id = std::move(id), options, handler = std::move(handler)](
@@ -115,59 +115,80 @@ namespace core::impl
115
115
  auto
116
116
  make_error(const core::error_context::query& core_ctx) -> error
117
117
  {
118
+ if (!core_ctx.ec) {
119
+ return {};
120
+ }
118
121
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
119
122
  }
120
123
 
121
124
  auto
122
125
  make_error(const query_error_context& core_ctx) -> error
123
126
  {
127
+ if (!core_ctx.ec()) {
128
+ return {};
129
+ }
124
130
  return { core_ctx.ec(), {}, internal_error_context::build_error_context(core_ctx) };
125
131
  }
126
132
 
127
133
  auto
128
134
  make_error(const core::error_context::search& core_ctx) -> error
129
135
  {
136
+ if (!core_ctx.ec) {
137
+ return {};
138
+ }
130
139
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
131
140
  }
132
141
 
133
142
  auto
134
143
  make_error(const core::error_context::analytics& core_ctx) -> error
135
144
  {
145
+ if (!core_ctx.ec) {
146
+ return {};
147
+ }
136
148
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
137
149
  }
138
150
 
139
151
  auto
140
152
  make_error(const core::error_context::http& core_ctx) -> error
141
153
  {
154
+ if (!core_ctx.ec) {
155
+ return {};
156
+ }
142
157
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
143
158
  }
144
159
 
145
160
  auto
146
161
  make_error(const couchbase::core::key_value_error_context& core_ctx) -> error
147
162
  {
163
+ if (!core_ctx.ec()) {
164
+ return {};
165
+ }
148
166
  return { core_ctx.ec(), {}, internal_error_context::build_error_context(core_ctx) };
149
167
  }
150
168
 
151
169
  auto
152
170
  make_error(const couchbase::core::subdocument_error_context& core_ctx) -> error
153
171
  {
172
+ if (!core_ctx.ec()) {
173
+ return {};
174
+ }
154
175
  return { core_ctx.ec(), {}, internal_error_context::build_error_context(core_ctx) };
155
176
  }
156
177
 
157
178
  auto
158
179
  make_error(const couchbase::core::transaction_error_context& ctx) -> error
159
180
  {
160
- return { ctx.ec(), "", {}, { ctx.cause() } };
181
+ return { ctx.ec(), {}, {}, { ctx.cause() } };
161
182
  }
162
183
 
163
184
  auto
164
185
  make_error(const couchbase::core::transaction_op_error_context& ctx) -> error
165
186
  {
166
187
  if (std::holds_alternative<key_value_error_context>(ctx.cause())) {
167
- return { ctx.ec(), "", {}, make_error(std::get<key_value_error_context>(ctx.cause())) };
188
+ return { ctx.ec(), {}, {}, make_error(std::get<key_value_error_context>(ctx.cause())) };
168
189
  }
169
190
  if (std::holds_alternative<query_error_context>(ctx.cause())) {
170
- return { ctx.ec(), "", {}, make_error(std::get<query_error_context>(ctx.cause())) };
191
+ return { ctx.ec(), {}, {}, make_error(std::get<query_error_context>(ctx.cause())) };
171
192
  }
172
193
  return ctx.ec();
173
194
  }