couchbase 4.4.2 → 4.4.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CMakeLists.txt +2 -0
- package/deps/couchbase-cxx-client/CMakeLists.txt +17 -14
- package/deps/couchbase-cxx-client/README.md +2 -2
- package/deps/couchbase-cxx-client/cmake/Packaging.cmake +4 -0
- package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
- package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +24 -2
- package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +43 -4
- package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
- package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
- package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
- package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
- package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
- package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
- package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
- package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
- package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
- package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
- package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
- package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
- package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
- package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
- package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +2 -2
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
- package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
- package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
- package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
- package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
- package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
- package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
- package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
- package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
- package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
- package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
- package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
- package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
- package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
- package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
- package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
- package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
- package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
- package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +16 -15
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
- package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
- package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
- package/package.json +8 -8
- package/src/binding.cpp +13 -13
@@ -34,7 +34,7 @@ using namespace tao::pegtl;
|
|
34
34
|
|
35
35
|
struct bucket_name : seq<uri::segment_nz> {
|
36
36
|
};
|
37
|
-
using param_key = star<sor<abnf::ALPHA, abnf::DIGIT, one<'_'>>>;
|
37
|
+
using param_key = star<sor<abnf::ALPHA, abnf::DIGIT, one<'_', '.'>>>;
|
38
38
|
using param_value = star<sor<minus<uri::pchar, one<'=', '&', '?'>>, one<'/'>>>;
|
39
39
|
struct param : seq<param_key, one<'='>, param_value> {
|
40
40
|
};
|
@@ -237,38 +237,69 @@ parse_option(bool& receiver,
|
|
237
237
|
}
|
238
238
|
|
239
239
|
void
|
240
|
-
parse_option(
|
240
|
+
parse_option(io::ip_protocol& receiver,
|
241
241
|
const std::string& name,
|
242
242
|
const std::string& value,
|
243
243
|
std::vector<std::string>& warnings)
|
244
244
|
{
|
245
|
-
if (value == "
|
246
|
-
receiver =
|
247
|
-
} else if (value == "
|
248
|
-
receiver =
|
245
|
+
if (value == "any") {
|
246
|
+
receiver = io::ip_protocol::any;
|
247
|
+
} else if (value == "force_ipv4") {
|
248
|
+
receiver = io::ip_protocol::force_ipv4;
|
249
|
+
} else if (value == "force_ipv6") {
|
250
|
+
receiver = io::ip_protocol::force_ipv6;
|
249
251
|
} else {
|
250
252
|
warnings.push_back(fmt::format(
|
251
|
-
R"(unable to parse "{}" parameter in connection string (value "{}" is not a valid
|
253
|
+
R"(unable to parse "{}" parameter in connection string (value "{}" is not a valid IP protocol preference))",
|
252
254
|
name,
|
253
255
|
value));
|
254
256
|
}
|
255
257
|
}
|
256
258
|
|
259
|
+
#ifdef COUCHBASE_CXX_CLIENT_COLUMNAR
|
257
260
|
void
|
258
|
-
parse_option(
|
261
|
+
parse_option(std::chrono::milliseconds& receiver,
|
259
262
|
const std::string& name,
|
260
263
|
const std::string& value,
|
261
264
|
std::vector<std::string>& warnings)
|
262
265
|
{
|
263
|
-
|
264
|
-
receiver =
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
266
|
+
try {
|
267
|
+
receiver = std::chrono::duration_cast<std::chrono::milliseconds>(
|
268
|
+
parse_duration(string_codec::url_decode(value)));
|
269
|
+
} catch (const duration_parse_error& dpe) {
|
270
|
+
warnings.push_back(
|
271
|
+
fmt::format(R"(unable to parse "{}" parameter in connection string (value: "{}"): {})",
|
272
|
+
name,
|
273
|
+
value,
|
274
|
+
dpe.what()));
|
275
|
+
} catch (const std::invalid_argument& ex1) {
|
276
|
+
warnings.push_back(fmt::format(
|
277
|
+
R"(unable to parse "{}" parameter in connection string (value "{}" is not a number): {})",
|
278
|
+
name,
|
279
|
+
value,
|
280
|
+
ex1.what()));
|
281
|
+
} catch (const std::out_of_range& ex2) {
|
282
|
+
warnings.push_back(fmt::format(
|
283
|
+
R"(unable to parse "{}" parameter in connection string (value "{}" is out of range): {})",
|
284
|
+
name,
|
285
|
+
value,
|
286
|
+
ex2.what()));
|
287
|
+
}
|
288
|
+
}
|
289
|
+
#else
|
290
|
+
void
|
291
|
+
parse_option(tls_verify_mode& receiver,
|
292
|
+
const std::string& name,
|
293
|
+
const std::string& value,
|
294
|
+
std::vector<std::string>& warnings)
|
295
|
+
{
|
296
|
+
if (value == "none") {
|
297
|
+
receiver = tls_verify_mode::none;
|
298
|
+
} else if (value == "peer") {
|
299
|
+
receiver = tls_verify_mode::peer;
|
269
300
|
} else {
|
270
301
|
warnings.push_back(fmt::format(
|
271
|
-
R"(unable to parse "{}" parameter in connection string (value "{}" is not a valid
|
302
|
+
R"(unable to parse "{}" parameter in connection string (value "{}" is not a valid TLS verification mode))",
|
272
303
|
name,
|
273
304
|
value));
|
274
305
|
}
|
@@ -323,6 +354,7 @@ parse_option(std::chrono::milliseconds& receiver,
|
|
323
354
|
}
|
324
355
|
}
|
325
356
|
}
|
357
|
+
#endif
|
326
358
|
|
327
359
|
void
|
328
360
|
extract_options(connection_string& connstr)
|
@@ -333,6 +365,54 @@ extract_options(connection_string& connstr)
|
|
333
365
|
connstr.options.enable_dns_srv = false;
|
334
366
|
}
|
335
367
|
for (const auto& [name, value] : connstr.params) {
|
368
|
+
#ifdef COUCHBASE_CXX_CLIENT_COLUMNAR
|
369
|
+
if (name == "security.trust_only_pem_file") {
|
370
|
+
/**
|
371
|
+
* Set the trust cert path
|
372
|
+
*/
|
373
|
+
parse_option(connstr.options.trust_certificate, name, value, connstr.warnings);
|
374
|
+
} else if (name == "security.disable_server_certificate_verification") {
|
375
|
+
/**
|
376
|
+
* Disable TLS server cert verification if set to true.
|
377
|
+
*/
|
378
|
+
if (value == "true" || value == "yes" || value == "on" || value == "1") {
|
379
|
+
connstr.options.tls_verify = tls_verify_mode::none;
|
380
|
+
} else if (value == "false" || value == "no" || value == "off" || value == "0") {
|
381
|
+
connstr.options.tls_verify = tls_verify_mode::peer;
|
382
|
+
} else {
|
383
|
+
connstr.warnings.push_back(fmt::format(
|
384
|
+
R"(unable to parse "{}" parameter in connection string (value "{}" cannot be interpreted as a boolean))",
|
385
|
+
name,
|
386
|
+
value));
|
387
|
+
}
|
388
|
+
|
389
|
+
} else if (name == "timeout.connect_timeout") {
|
390
|
+
/**
|
391
|
+
* The period of time allocated to complete bootstrap
|
392
|
+
*/
|
393
|
+
parse_option(connstr.options.bootstrap_timeout, name, value, connstr.warnings);
|
394
|
+
} else if (name == "timeout.dispatch_timeout") {
|
395
|
+
/**
|
396
|
+
* Number of seconds to wait before timing out a Query or N1QL request by the client.
|
397
|
+
*/
|
398
|
+
parse_option(connstr.options.dispatch_timeout, name, value, connstr.warnings);
|
399
|
+
} else if (name == "timeout.query_timeout") {
|
400
|
+
/**
|
401
|
+
* Number of seconds to wait before timing out a Query or N1QL request by the client.
|
402
|
+
*/
|
403
|
+
parse_option(connstr.options.query_timeout, name, value, connstr.warnings);
|
404
|
+
} else if (name == "timeout.resolve_timeout") {
|
405
|
+
/**
|
406
|
+
* The period of time to resolve DNS name of the node to IP address
|
407
|
+
*/
|
408
|
+
parse_option(connstr.options.resolve_timeout, name, value, connstr.warnings);
|
409
|
+
} else if (name == "timeout.socket_connect_timeout") {
|
410
|
+
/**
|
411
|
+
* Number of seconds the client should wait while attempting to connect to a node’s KV service
|
412
|
+
* via a socket. Initial connection, reconnecting, node added, etc.
|
413
|
+
*/
|
414
|
+
parse_option(connstr.options.connect_timeout, name, value, connstr.warnings);
|
415
|
+
#else
|
336
416
|
if (name == "kv_connect_timeout") {
|
337
417
|
/**
|
338
418
|
* Number of seconds the client should wait while attempting to connect to a node’s KV service
|
@@ -404,6 +484,7 @@ extract_options(connection_string& connstr)
|
|
404
484
|
if (force_ipv4) {
|
405
485
|
connstr.options.use_ip_protocol = io::ip_protocol::force_ipv4;
|
406
486
|
}
|
487
|
+
#endif
|
407
488
|
} else if (name == "ip_protocol") {
|
408
489
|
/**
|
409
490
|
* Controls preference of IP protocol for name resolution
|
@@ -413,6 +494,37 @@ extract_options(connection_string& connstr)
|
|
413
494
|
parse_option(connstr.options.config_poll_interval, name, value, connstr.warnings);
|
414
495
|
} else if (name == "config_poll_floor") {
|
415
496
|
parse_option(connstr.options.config_poll_floor, name, value, connstr.warnings);
|
497
|
+
} else if (name == "enable_dns_srv") {
|
498
|
+
if (connstr.bootstrap_nodes.size() == 1) {
|
499
|
+
parse_option(connstr.options.enable_dns_srv, name, value, connstr.warnings);
|
500
|
+
} else {
|
501
|
+
connstr.warnings.push_back(fmt::format(
|
502
|
+
R"(parameter "{}" requires single entry in bootstrap nodes list of the connection string, ignoring (value "{}"))",
|
503
|
+
name,
|
504
|
+
value));
|
505
|
+
}
|
506
|
+
} else if (name == "network") {
|
507
|
+
connstr.options.network =
|
508
|
+
value; /* current known values are "auto", "default" and "external" */
|
509
|
+
} else if (name == "user_agent_extra") {
|
510
|
+
/**
|
511
|
+
* string, that will be appended to identification fields of the server protocols (key in HELO
|
512
|
+
* packet for MCBP, "user-agent" header for HTTP)
|
513
|
+
*/
|
514
|
+
parse_option(connstr.options.user_agent_extra, name, value, connstr.warnings);
|
515
|
+
} else if (name == "dump_configuration") {
|
516
|
+
/**
|
517
|
+
* Whether to dump every new configuration on TRACE level
|
518
|
+
*/
|
519
|
+
parse_option(connstr.options.dump_configuration, name, value, connstr.warnings);
|
520
|
+
} else if (name == "enable_clustermap_notification") {
|
521
|
+
/**
|
522
|
+
* Allow the server to push configuration updates asynchronously.
|
523
|
+
*/
|
524
|
+
parse_option(connstr.options.enable_clustermap_notification, name, value, connstr.warnings);
|
525
|
+
} else if (name == "disable_mozilla_ca_certificates") {
|
526
|
+
parse_option(connstr.options.disable_mozilla_ca_certificates, name, value, connstr.warnings);
|
527
|
+
#ifndef COUCHBASE_CXX_CLIENT_COLUMNAR
|
416
528
|
} else if (name == "max_http_connections") {
|
417
529
|
/**
|
418
530
|
* The maximum number of HTTP connections allowed on a per-host and per-port basis. 0
|
@@ -429,40 +541,16 @@ extract_options(connection_string& connstr)
|
|
429
541
|
* The period of time allocated to complete bootstrap
|
430
542
|
*/
|
431
543
|
parse_option(connstr.options.bootstrap_timeout, name, value, connstr.warnings);
|
432
|
-
#ifdef COUCHBASE_CXX_CLIENT_COLUMNAR
|
433
|
-
} else if (name == "dispatch_timeout") {
|
434
|
-
/**
|
435
|
-
* The period of time allocated to complete HTTP session bootstrap
|
436
|
-
*/
|
437
|
-
parse_option(connstr.options.dispatch_timeout, name, value, connstr.warnings);
|
438
|
-
#endif
|
439
544
|
} else if (name == "resolve_timeout") {
|
440
545
|
/**
|
441
546
|
* The period of time to resolve DNS name of the node to IP address
|
442
547
|
*/
|
443
548
|
parse_option(connstr.options.resolve_timeout, name, value, connstr.warnings);
|
444
|
-
} else if (name == "enable_dns_srv") {
|
445
|
-
if (connstr.bootstrap_nodes.size() == 1) {
|
446
|
-
parse_option(connstr.options.enable_dns_srv, name, value, connstr.warnings);
|
447
|
-
} else {
|
448
|
-
connstr.warnings.push_back(fmt::format(
|
449
|
-
R"(parameter "{}" requires single entry in bootstrap nodes list of the connection string, ignoring (value "{}"))",
|
450
|
-
name,
|
451
|
-
value));
|
452
|
-
}
|
453
|
-
} else if (name == "network") {
|
454
|
-
connstr.options.network =
|
455
|
-
value; /* current known values are "auto", "default" and "external" */
|
456
549
|
} else if (name == "show_queries") {
|
457
550
|
/**
|
458
551
|
* Whether to display N1QL, Analytics, Search queries on info level (default false)
|
459
552
|
*/
|
460
553
|
parse_option(connstr.options.show_queries, name, value, connstr.warnings);
|
461
|
-
} else if (name == "enable_clustermap_notification") {
|
462
|
-
/**
|
463
|
-
* Allow the server to push configuration updates asynchronously.
|
464
|
-
*/
|
465
|
-
parse_option(connstr.options.enable_clustermap_notification, name, value, connstr.warnings);
|
466
554
|
} else if (name == "enable_unordered_execution") {
|
467
555
|
/**
|
468
556
|
* Allow the server to reorder commands
|
@@ -487,25 +575,13 @@ extract_options(connection_string& connstr)
|
|
487
575
|
parse_option(connstr.options.enable_metrics, name, value, connstr.warnings);
|
488
576
|
} else if (name == "tls_verify") {
|
489
577
|
parse_option(connstr.options.tls_verify, name, value, connstr.warnings);
|
490
|
-
} else if (name == "disable_mozilla_ca_certificates") {
|
491
|
-
parse_option(connstr.options.disable_mozilla_ca_certificates, name, value, connstr.warnings);
|
492
578
|
} else if (name == "tls_disable_deprecated_protocols") {
|
493
579
|
parse_option(connstr.options.tls_disable_deprecated_protocols, name, value, connstr.warnings);
|
494
580
|
} else if (name == "tls_disable_v1_2") {
|
495
581
|
parse_option(connstr.options.tls_disable_v1_2, name, value, connstr.warnings);
|
496
|
-
} else if (name == "user_agent_extra") {
|
497
|
-
/**
|
498
|
-
* string, that will be appended to identification fields of the server protocols (key in HELO
|
499
|
-
* packet for MCBP, "user-agent" header for HTTP)
|
500
|
-
*/
|
501
|
-
parse_option(connstr.options.user_agent_extra, name, value, connstr.warnings);
|
502
|
-
} else if (name == "dump_configuration") {
|
503
|
-
/**
|
504
|
-
* Whether to dump every new configuration on TRACE level
|
505
|
-
*/
|
506
|
-
parse_option(connstr.options.dump_configuration, name, value, connstr.warnings);
|
507
582
|
} else if (name == "server_group") {
|
508
583
|
parse_option(connstr.options.server_group, name, value, connstr.warnings);
|
584
|
+
#endif
|
509
585
|
} else {
|
510
586
|
connstr.warnings.push_back(
|
511
587
|
fmt::format(R"(unknown parameter "{}" in connection string (value "{}"))", name, value));
|
@@ -241,7 +241,7 @@ struct analytics_options : public common_options<analytics_options> {
|
|
241
241
|
std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
|
242
242
|
auto raw(std::string name, const Value& value) -> analytics_options&
|
243
243
|
{
|
244
|
-
raw_[std::move(name)] = std::move(Serializer::template serialize(value));
|
244
|
+
raw_[std::move(name)] = std::move(Serializer::template serialize<const Value&>(value));
|
245
245
|
return self();
|
246
246
|
}
|
247
247
|
|
@@ -359,7 +359,8 @@ private:
|
|
359
359
|
std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
|
360
360
|
void encode_positional_parameters(const Parameter& parameter, Rest... args)
|
361
361
|
{
|
362
|
-
positional_parameters_.emplace_back(
|
362
|
+
positional_parameters_.emplace_back(
|
363
|
+
std::move(Serializer::template serialize<Parameter>(parameter)));
|
363
364
|
if constexpr (sizeof...(args) > 0) {
|
364
365
|
encode_positional_parameters<Serializer>(args...);
|
365
366
|
}
|
@@ -373,7 +374,7 @@ private:
|
|
373
374
|
void encode_named_parameters(const std::pair<Name, Parameter>& parameter, Rest... args)
|
374
375
|
{
|
375
376
|
named_parameters_[parameter.first] =
|
376
|
-
std::move(Serializer::template serialize(parameter.second));
|
377
|
+
std::move(Serializer::template serialize<Parameter>(parameter.second));
|
377
378
|
if constexpr (sizeof...(args) > 0) {
|
378
379
|
encode_named_parameters<Serializer>(args...);
|
379
380
|
}
|
@@ -47,7 +47,7 @@ public:
|
|
47
47
|
static auto serialize([[maybe_unused]] Document document) -> binary
|
48
48
|
{
|
49
49
|
try {
|
50
|
-
if constexpr (std::is_null_pointer_v<Document
|
50
|
+
if constexpr (std::is_null_pointer_v<std::remove_reference_t<Document>>) {
|
51
51
|
return core::utils::json::generate_binary(tao::json::null);
|
52
52
|
} else {
|
53
53
|
return core::utils::json::generate_binary(tao::json::value(document));
|
@@ -235,7 +235,7 @@ public:
|
|
235
235
|
template<typename Value, typename Transcoder = codec::default_json_transcoder>
|
236
236
|
static auto upsert(std::string path, const Value& value) -> subdoc::upsert
|
237
237
|
{
|
238
|
-
return { std::move(path), std::move(Transcoder::template encode(value).data) };
|
238
|
+
return { std::move(path), std::move(Transcoder::template encode<const Value&>(value).data) };
|
239
239
|
}
|
240
240
|
|
241
241
|
/**
|
@@ -453,7 +453,7 @@ public:
|
|
453
453
|
template<typename Value, typename Transcoder = codec::default_json_transcoder>
|
454
454
|
static auto array_add_unique(std::string path, const Value& value) -> subdoc::array_add_unique
|
455
455
|
{
|
456
|
-
return { std::move(path), std::move(Transcoder::template encode(value).data) };
|
456
|
+
return { std::move(path), std::move(Transcoder::template encode<Value>(value).data) };
|
457
457
|
}
|
458
458
|
|
459
459
|
/**
|
@@ -445,7 +445,7 @@ struct query_options : public common_options<query_options> {
|
|
445
445
|
std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
|
446
446
|
auto raw(std::string name, const Value& value) -> query_options&
|
447
447
|
{
|
448
|
-
raw_[std::move(name)] = std::move(Serializer::template serialize(value));
|
448
|
+
raw_[std::move(name)] = std::move(Serializer::template serialize<const Value&>(value));
|
449
449
|
return self();
|
450
450
|
}
|
451
451
|
|
@@ -563,7 +563,8 @@ private:
|
|
563
563
|
std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
|
564
564
|
void encode_positional_parameters(const Parameter& parameter, Rest... args)
|
565
565
|
{
|
566
|
-
positional_parameters_.emplace_back(
|
566
|
+
positional_parameters_.emplace_back(
|
567
|
+
std::move(Serializer::template serialize<const Parameter&>(parameter)));
|
567
568
|
if constexpr (sizeof...(args) > 0) {
|
568
569
|
encode_positional_parameters<Serializer>(args...);
|
569
570
|
}
|
@@ -577,7 +578,7 @@ private:
|
|
577
578
|
void encode_named_parameters(const std::pair<Name, Parameter>& parameter, Rest... args)
|
578
579
|
{
|
579
580
|
named_parameters_[parameter.first] =
|
580
|
-
std::move(Serializer::template serialize(parameter.second));
|
581
|
+
std::move(Serializer::template serialize<Parameter>(parameter.second));
|
581
582
|
if constexpr (sizeof...(args) > 0) {
|
582
583
|
encode_named_parameters<Serializer>(args...);
|
583
584
|
}
|
@@ -192,7 +192,7 @@ struct search_options : public common_options<search_options> {
|
|
192
192
|
std::enable_if_t<codec::is_serializer_v<Serializer>, bool> = true>
|
193
193
|
auto raw(std::string name, const Value& value) -> search_options&
|
194
194
|
{
|
195
|
-
raw_[std::move(name)] = std::move(Serializer::template serialize(value));
|
195
|
+
raw_[std::move(name)] = std::move(Serializer::template serialize<Value>(value));
|
196
196
|
return self();
|
197
197
|
}
|
198
198
|
|
package/package.json
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
"type": "git",
|
55
55
|
"url": "http://github.com/couchbase/couchnode.git"
|
56
56
|
},
|
57
|
-
"version": "4.4.
|
57
|
+
"version": "4.4.3",
|
58
58
|
"config": {
|
59
59
|
"native": false
|
60
60
|
},
|
@@ -79,13 +79,13 @@
|
|
79
79
|
]
|
80
80
|
},
|
81
81
|
"optionalDependencies": {
|
82
|
-
"@couchbase/couchbase-darwin-arm64-napi": "4.4.
|
83
|
-
"@couchbase/couchbase-darwin-x64-napi": "4.4.
|
84
|
-
"@couchbase/couchbase-linux-arm64-napi": "4.4.
|
85
|
-
"@couchbase/couchbase-linuxmusl-arm64-napi": "4.4.
|
86
|
-
"@couchbase/couchbase-linuxmusl-x64-napi": "4.4.
|
87
|
-
"@couchbase/couchbase-linux-x64-napi": "4.4.
|
88
|
-
"@couchbase/couchbase-win32-x64-napi": "4.4.
|
82
|
+
"@couchbase/couchbase-darwin-arm64-napi": "4.4.3",
|
83
|
+
"@couchbase/couchbase-darwin-x64-napi": "4.4.3",
|
84
|
+
"@couchbase/couchbase-linux-arm64-napi": "4.4.3",
|
85
|
+
"@couchbase/couchbase-linuxmusl-arm64-napi": "4.4.3",
|
86
|
+
"@couchbase/couchbase-linuxmusl-x64-napi": "4.4.3",
|
87
|
+
"@couchbase/couchbase-linux-x64-napi": "4.4.3",
|
88
|
+
"@couchbase/couchbase-win32-x64-napi": "4.4.3"
|
89
89
|
},
|
90
90
|
"files": [
|
91
91
|
"LICENSE",
|
package/src/binding.cpp
CHANGED
@@ -9,7 +9,6 @@
|
|
9
9
|
#include <core/logger/configuration.hxx>
|
10
10
|
#include <core/meta/version.hxx>
|
11
11
|
#include <napi.h>
|
12
|
-
#include <spdlog/spdlog.h>
|
13
12
|
|
14
13
|
namespace couchnode
|
15
14
|
{
|
@@ -39,40 +38,41 @@ Napi::Value shutdown_logger(const Napi::CallbackInfo &info)
|
|
39
38
|
|
40
39
|
Napi::Object Init(Napi::Env env, Napi::Object exports)
|
41
40
|
{
|
42
|
-
spdlog::set_pattern("[%Y-%m-%d %T.%e] [%P,%t] [%^%l%$] %oms, %v");
|
43
|
-
|
44
|
-
auto spdLogLevel = spdlog::level::off;
|
45
41
|
auto cbppLogLevel = couchbase::core::logger::level::off;
|
46
42
|
{
|
47
43
|
const char *logLevelCstr = getenv("CBPPLOGLEVEL");
|
48
44
|
if (logLevelCstr) {
|
49
45
|
std::string logLevelStr = logLevelCstr;
|
50
46
|
if (logLevelStr == "trace") {
|
51
|
-
spdLogLevel = spdlog::level::trace;
|
52
47
|
cbppLogLevel = couchbase::core::logger::level::trace;
|
53
48
|
} else if (logLevelStr == "debug") {
|
54
|
-
spdLogLevel = spdlog::level::debug;
|
55
49
|
cbppLogLevel = couchbase::core::logger::level::debug;
|
56
50
|
} else if (logLevelStr == "info") {
|
57
|
-
spdLogLevel = spdlog::level::info;
|
58
51
|
cbppLogLevel = couchbase::core::logger::level::info;
|
59
52
|
} else if (logLevelStr == "warn") {
|
60
|
-
spdLogLevel = spdlog::level::warn;
|
61
53
|
cbppLogLevel = couchbase::core::logger::level::warn;
|
62
54
|
} else if (logLevelStr == "err") {
|
63
|
-
spdLogLevel = spdlog::level::err;
|
64
55
|
cbppLogLevel = couchbase::core::logger::level::err;
|
65
56
|
} else if (logLevelStr == "critical") {
|
66
|
-
spdLogLevel = spdlog::level::critical;
|
67
57
|
cbppLogLevel = couchbase::core::logger::level::critical;
|
68
58
|
}
|
69
59
|
}
|
70
60
|
}
|
61
|
+
|
71
62
|
if (cbppLogLevel != couchbase::core::logger::level::off) {
|
72
|
-
|
63
|
+
const char *logFileCstr = getenv("CBPPLOGFILE");
|
64
|
+
if (logFileCstr) {
|
65
|
+
std::string logFileStr = logFileCstr;
|
66
|
+
couchbase::core::logger::configuration configuration{};
|
67
|
+
configuration.filename = logFileStr;
|
68
|
+
configuration.log_level = cbppLogLevel;
|
69
|
+
couchbase::core::logger::create_file_logger(configuration);
|
70
|
+
|
71
|
+
} else {
|
72
|
+
couchbase::core::logger::create_console_logger();
|
73
|
+
couchbase::core::logger::set_log_levels(cbppLogLevel);
|
74
|
+
}
|
73
75
|
}
|
74
|
-
spdlog::set_level(spdLogLevel);
|
75
|
-
couchbase::core::logger::set_log_levels(cbppLogLevel);
|
76
76
|
|
77
77
|
AddonData::Init(env, exports);
|
78
78
|
Constants::Init(env, exports);
|