1#ifndef _DITTO_DQL_QUERY_RESULT_
2#define _DITTO_DQL_QUERY_RESULT_
4#include "DocumentId.hpp"
12#include <unordered_map>
15typedef struct CDqlResponse CDqlResponse_t;
16typedef struct CDqlResult CDqlResult_t;
19using ValueMap = std::unordered_map<std::string, any>;
34 std::shared_ptr<CDqlResult> raw;
35 mutable std::shared_ptr<ValueMap> materialized_value;
36 mutable std::unique_ptr<std::mutex>
synchronized;
52 std::shared_ptr<ValueMap>
value()
const;
109 std::shared_ptr<CDqlResponse_t> raw;
125 std::vector<QueryResultItem>
items()
const;
Representes the returned results when executing a DQL query, containing a QueryResultItem for each ma...
Definition QueryResult.hpp:104
QueryResultItem get_item(size_t index) const
Returns the matching QueryResultItem.
Definition QueryResult.cpp:20
std::vector< QueryResultItem > items() const
Definition QueryResult.cpp:29
std::vector< DocumentId > mutated_document_ids() const
IDs of documents that were mutated by the DQL query. Empty array if no documents have been mutated.
Definition QueryResult.cpp:40
size_t item_count() const
Definition QueryResult.cpp:16
Represents a single match of a DQL query, similar to a "row" in SQL terms. It is a reference type ser...
Definition QueryResult.hpp:28
void dematerialize()
Releases the materialized value from memory. No-op if item is not materialized.
Definition QueryResult.cpp:84
std::string json_string() const
Returns the content of the item as a JSON string.
Definition QueryResult.cpp:86
std::shared_ptr< ValueMap > value() const
Returns the content as a materialized value map.
Definition QueryResult.cpp:63
std::vector< uint8_t > cbor_data() const
Returns the content of the item as CBOR data.
Definition QueryResult.cpp:93
bool is_materialized() const
Returns true if value is currently held materialized in memory, otherwise returns false.
Definition QueryResult.cpp:69
void materialize()
Loads the CBOR representation of the item's content, decodes it as a dictionary so it can be accessed...
Definition QueryResult.cpp:76
Provides access to Collections and a write transaction API.
Definition Store.hpp:25
Definition StoreObserver.hpp:45