66 const std::string&
id) -> std::pair<error, transaction_get_result> = 0;
91 const std::string&
id)
92 -> std::pair<error, transaction_get_result> = 0;
111 std::enable_if_t<!std::is_same_v<codec::encoded_value, Document>,
bool> =
true>
113 const std::string&
id,
114 const Document& content) -> std::pair<error, transaction_get_result>
118 data = Transcoder::encode(content);
119 }
catch (std::system_error& e) {
120 return {
error(e.code(), e.what()), {} };
121 }
catch (std::runtime_error& e) {
124 return insert_raw(coll,
id, data);
153 std::enable_if_t<!std::is_same_v<codec::encoded_value, Document>,
bool> =
true>
155 const Document& content) -> std::pair<error, transaction_get_result>
159 data = Transcoder::encode(content);
160 }
catch (std::system_error& e) {
161 return {
error(e.code(), e.what()), {} };
162 }
catch (std::runtime_error& e) {
165 return replace_raw(doc, data);
189 -> std::pair<error, transaction_query_result>;
201 const std::string& statement,
203 -> std::pair<error, transaction_query_result>;
210 -> std::pair<error, transaction_get_result> = 0;
213 const std::string&
id,
215 -> std::pair<error, transaction_get_result> = 0;
217 virtual auto do_public_query(
const std::string& statement,
219 std::optional<std::string> query_context)
220 -> std::pair<error, transaction_query_result> = 0;
The collection provides access to all collection APIs.
Definition collection.hxx:70
The scope identifies a group of collections and allows high application density as a result.
Definition scope.hxx:47
The attempt_context is used for all synchronous transaction operations.
Definition attempt_context.hxx:40
auto query(const scope &scope, const std::string &statement, const transaction_query_options &opts={}) -> std::pair< error, transaction_query_result >
Perform a scoped query.
virtual auto get_replica_from_preferred_server_group(const couchbase::collection &coll, const std::string &id) -> std::pair< error, transaction_get_result >=0
Get a document copy from the selected server group.
auto insert(const couchbase::collection &coll, const std::string &id, const Document &content) -> std::pair< error, transaction_get_result >
Insert a document into a collection.
Definition attempt_context.hxx:112
auto query(const std::string &statement, const transaction_query_options &options={}) -> std::pair< error, transaction_query_result >
Perform an unscoped query.
virtual ~attempt_context()=default
virtual auto remove(const transaction_get_result &doc) -> error=0
Remove a document.
virtual auto get(const couchbase::collection &coll, const std::string &id) -> std::pair< error, transaction_get_result >=0
Get a document from a collection.
auto replace(const transaction_get_result &doc, const Document &content) -> std::pair< error, transaction_get_result >
Replace the contents of a document in a collection.
Definition attempt_context.hxx:154
The representation of the document in context of distributed transaction.
Definition transaction_get_result.hxx:57
The transaction_query_options are options specific to a query.
Definition transaction_query_options.hxx:35
json_transcoder< tao_json_serializer > default_json_transcoder
Definition default_json_transcoder.hxx:28
@ encoding_failure
Returned when encoding of a user object failed while trying to write it to the cluster.
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
@ error
Indicates that the ping operation failed.
Definition encoded_value.hxx:27