Skip to content

update core to 1.0.0-beta.5 #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions Couchbase/QueryOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class QueryOptions
private ?string $clientContextId = null;
private ?bool $metrics = null;
private ?bool $preserveExpiry = null;
private ?string $scopeName = null;
private ?string $scopeQualifier = null;
private ?string $queryContext = null;
private Transcoder $transcoder;

/**
Expand Down Expand Up @@ -332,7 +331,6 @@ public function scopeName(string $name): QueryOptions
'Method ' . __METHOD__ . ' is deprecated, use scope level query()',
E_USER_DEPRECATED
);
$this->scopeName = $name;
return $this;
}

Expand All @@ -353,7 +351,7 @@ public function scopeQualifier(string $qualifier): QueryOptions
'Method ' . __METHOD__ . ' is deprecated, use scope level query()',
E_USER_DEPRECATED
);
$this->scopeQualifier = $qualifier;
$this->queryContext = $qualifier;
return $this;
}

Expand Down Expand Up @@ -403,10 +401,14 @@ public static function getTranscoder(?QueryOptions $options): Transcoder

public static function export(?QueryOptions $options, string $scopeName = null, string $bucketName = null): array
{
$defaultQueryContext = null;
if ($scopeName != null && $bucketName != null) {
$defaultQueryContext = sprintf("default:`%s`.`%s`", $bucketName, $scopeName);
}

if ($options == null) {
return [
'scopeName' => $scopeName,
'bucketName' => $bucketName,
'queryContext' => $defaultQueryContext
];
}

Expand All @@ -428,9 +430,6 @@ public static function export(?QueryOptions $options, string $scopeName = null,
$raw[$key] = json_encode($param);
}
}
if ($scopeName == null && $options->scopeName != null) {
$scopeName = $options->scopeName;
}

return [
'timeoutMilliseconds' => $options->timeoutMilliseconds,
Expand All @@ -452,9 +451,7 @@ public static function export(?QueryOptions $options, string $scopeName = null,
'clientContextId' => $options->clientContextId,
'metrics' => $options->metrics,
'preserveExpiry' => $options->preserveExpiry,
'scopeName' => $scopeName,
'bucketName' => $bucketName,
'scopeQualifier' => $options->scopeQualifier,
'queryContext' => $options->queryContext == null ? $defaultQueryContext : $options->queryContext,
];
}
}
20 changes: 18 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<email>sergey@couchbase.com</email>
<active>yes</active>
</lead>
<date>2023-02-16</date>
<date>2023-02-19</date>
<version>
<release>4.1.0</release>
<api>4.0.0</api>
Expand Down Expand Up @@ -425,16 +425,20 @@
<file role="src" name="bootstrap_state_listener.hxx"/>
<file role="src" name="build_deferred_query_indexes.cxx"/>
<file role="src" name="cluster.cxx"/>
<file role="src" name="collection_query_index_manager.cxx"/>
<file role="src" name="common_error_category.cxx"/>
<file role="src" name="configuration_profiles_registry.cxx"/>
<file role="src" name="create_query_index.cxx"/>
<file role="src" name="decrement.cxx"/>
<file role="src" name="dns_srv_tracker.cxx"/>
<file role="src" name="dns_srv_tracker.hxx"/>
<file role="src" name="drop_query_index.cxx"/>
<file role="src" name="exists.cxx"/>
<file role="src" name="expiry.cxx"/>
<file role="src" name="fail_fast_retry_strategy.cxx"/>
<file role="src" name="field_level_encryption_error_category.cxx"/>
<file role="src" name="get.cxx"/>
<file role="src" name="get_all_query_indexes.cxx"/>
<file role="src" name="get_all_replicas.cxx"/>
<file role="src" name="get_all_replicas.hxx"/>
<file role="src" name="get_and_lock.cxx"/>
Expand Down Expand Up @@ -469,6 +473,7 @@
<file role="src" name="unlock.cxx"/>
<file role="src" name="upsert.cxx"/>
<file role="src" name="view_error_category.cxx"/>
<file role="src" name="watch_query_indexes.cxx"/>
<file role="src" name="with_legacy_durability.hxx"/>
</dir>
<dir name="io">
Expand Down Expand Up @@ -529,7 +534,6 @@
<file role="src" name="eventing_function_json.hxx"/>
<file role="src" name="eventing_status.hxx"/>
<file role="src" name="eventing_status_json.hxx"/>
<file role="src" name="query_index.hxx"/>
<file role="src" name="rbac.hxx"/>
<file role="src" name="rbac_fmt.hxx"/>
<file role="src" name="rbac_json.hxx"/>
Expand Down Expand Up @@ -1005,6 +1009,7 @@
<file role="src" name="json_stream_control.hxx"/>
<file role="src" name="json_streaming_lexer.cxx"/>
<file role="src" name="json_streaming_lexer.hxx"/>
<file role="src" name="keyspace.hxx"/>
<file role="src" name="movable_function.hxx"/>
<file role="src" name="mutation_token.cxx"/>
<file role="src" name="mutation_token.hxx"/>
Expand Down Expand Up @@ -1079,6 +1084,7 @@
<file role="src" name="ping_collector.hxx"/>
<file role="src" name="ping_options.hxx"/>
<file role="src" name="ping_reporter.hxx"/>
<file role="src" name="query_context.hxx"/>
<file role="src" name="range_scan_options.cxx"/>
<file role="src" name="range_scan_options.hxx"/>
<file role="src" name="range_scan_orchestrator.cxx"/>
Expand Down Expand Up @@ -1133,6 +1139,9 @@
<file role="src" name="retry_reason.hxx"/>
<file role="src" name="tls_verify_mode.hxx"/>
</dir>
<dir name="management">
<file role="src" name="query_index.hxx"/>
</dir>
<dir name="metrics">
<file role="src" name="meter.hxx"/>
<file role="src" name="otel_meter.hxx"/>
Expand Down Expand Up @@ -1185,21 +1194,27 @@
<file role="src" name="cluster.hxx"/>
<file role="src" name="cluster_options.hxx"/>
<file role="src" name="collection.hxx"/>
<file role="src" name="collection_query_index_manager.hxx"/>
<file role="src" name="common_durability_options.hxx"/>
<file role="src" name="common_options.hxx"/>
<file role="src" name="compression_options.hxx"/>
<file role="src" name="configuration_profile.hxx"/>
<file role="src" name="configuration_profiles_registry.hxx"/>
<file role="src" name="counter_result.hxx"/>
<file role="src" name="create_primary_query_index_options.hxx"/>
<file role="src" name="create_query_index_options.hxx"/>
<file role="src" name="decrement_options.hxx"/>
<file role="src" name="dns_options.hxx"/>
<file role="src" name="drop_primary_query_index_options.hxx"/>
<file role="src" name="drop_query_index_options.hxx"/>
<file role="src" name="durability_level.hxx"/>
<file role="src" name="error_codes.hxx"/>
<file role="src" name="error_context.hxx"/>
<file role="src" name="exists_options.hxx"/>
<file role="src" name="exists_result.hxx"/>
<file role="src" name="expiry.hxx"/>
<file role="src" name="fail_fast_retry_strategy.hxx"/>
<file role="src" name="get_all_query_indexes_options.hxx"/>
<file role="src" name="get_all_replicas_options.hxx"/>
<file role="src" name="get_and_lock_options.hxx"/>
<file role="src" name="get_and_touch_options.hxx"/>
Expand Down Expand Up @@ -1262,6 +1277,7 @@
<file role="src" name="unlock_options.hxx"/>
<file role="src" name="upsert_options.hxx"/>
<file role="src" name="wan_development_configuration_profile.hxx"/>
<file role="src" name="watch_query_indexes_options.hxx"/>
</dir>
<dir name="third_party">
<dir name="asio">
Expand Down
2 changes: 1 addition & 1 deletion src/deps/couchbase-cxx-client
5 changes: 1 addition & 4 deletions src/wrapper/conversion_utilities.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,7 @@ zval_to_query_request(const zend_string* statement, const zval* options)
if (auto e = cb_assign_boolean(request.preserve_expiry, options, "preserveExpiry"); e.ec) {
return { {}, e };
}
if (auto e = cb_assign_string(request.scope_name, options, "scopeName"); e.ec) {
return { {}, e };
}
if (auto e = cb_assign_string(request.bucket_name, options, "bucketName"); e.ec) {
if (auto e = cb_assign_string(request.query_context, options, "queryContext"); e.ec) {
return { {}, e };
}
return { request, {} };
Expand Down
5 changes: 3 additions & 2 deletions src/wrapper/transaction_context_resource.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ build_error_context(const core::transactions::transaction_exception& e)
out.type = failure_type_to_string(e.type());
out.cause = external_exception_to_string(e.cause());
transactions_error_context::transaction_result res;
res.transaction_id = e.get_transaction_result().transaction_id;
res.unstaging_complete = e.get_transaction_result().unstaging_complete;
auto [_, core_res] = e.get_transaction_result();
res.transaction_id = core_res.transaction_id;
res.unstaging_complete = core_res.unstaging_complete;
out.result = res;
return out;
}
Expand Down