Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
query_meta_data.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2020-Present Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
24
25#include <cinttypes>
26#include <optional>
27#include <vector>
28
29namespace couchbase
30{
31
39{
40public:
45 query_meta_data() = default;
46
52 std::string client_context_id,
54 std::vector<query_warning> warnings,
55 std::optional<query_metrics> metrics,
56 std::optional<codec::binary> signature,
57 std::optional<codec::binary> profile)
58 : request_id_{ std::move(request_id) }
59 , client_context_id_{ std::move(client_context_id) }
60 , status_{ status }
61 , warnings_{ std::move(warnings) }
62 , metrics_{ std::move(metrics) }
63 , signature_{ std::move(signature) }
64 , profile_{ std::move(profile) }
65 {
66 }
67
76 [[nodiscard]] auto request_id() const -> const std::string&
77 {
78 return request_id_;
79 }
80
89 [[nodiscard]] auto client_context_id() const -> const std::string&
90 {
91 return client_context_id_;
92 }
93
102 [[nodiscard]] auto status() const -> query_status
103 {
104 return status_;
105 }
106
117 [[nodiscard]] auto warnings() const -> const std::vector<query_warning>&
118 {
119 return warnings_;
120 }
121
130 [[nodiscard]] auto metrics() const -> const std::optional<query_metrics>&
131 {
132 return metrics_;
133 }
134
143 [[nodiscard]] auto signature() const -> const std::optional<codec::binary>&
144 {
145 return signature_;
146 }
147
156 [[nodiscard]] auto profile() const -> const std::optional<codec::binary>&
157 {
158 return profile_;
159 }
160
161private:
162 std::string request_id_{};
163 std::string client_context_id_{};
164 query_status status_{};
165 std::vector<query_warning> warnings_{};
166 std::optional<query_metrics> metrics_{};
167 std::optional<codec::binary> signature_{};
168 std::optional<codec::binary> profile_{};
169};
170
171} // namespace couchbase
Stores any non-rows results related to the execution of a particular N1QL query.
Definition query_meta_data.hxx:39
auto status() const -> query_status
Returns the raw query execution status as returned by the query engine.
Definition query_meta_data.hxx:102
auto signature() const -> const std::optional< codec::binary > &
Returns the signature as returned by the query engine.
Definition query_meta_data.hxx:143
auto client_context_id() const -> const std::string &
Returns the client context identifier string set on the query request.
Definition query_meta_data.hxx:89
query_meta_data(std::string request_id, std::string client_context_id, query_status status, std::vector< query_warning > warnings, std::optional< query_metrics > metrics, std::optional< codec::binary > signature, std::optional< codec::binary > profile)
Definition query_meta_data.hxx:51
auto warnings() const -> const std::vector< query_warning > &
Returns any warnings returned by the query engine.
Definition query_meta_data.hxx:117
auto request_id() const -> const std::string &
Returns the request identifier string of the query request.
Definition query_meta_data.hxx:76
auto profile() const -> const std::optional< codec::binary > &
Returns the profiling information returned by the query engine.
Definition query_meta_data.hxx:156
auto metrics() const -> const std::optional< query_metrics > &
Returns the query_metrics as returned by the query engine if enabled.
Definition query_meta_data.hxx:130
Query Metrics contains the query result metrics containing counts and timings.
Definition query_metrics.hxx:33
Represents a single warning returned from the query engine.
Definition query_warning.hxx:37
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
query_status
Status of the N1QL Query.
Definition query_status.hxx:29