1#ifndef _DITTO_DQL_QUERY_RESULT_
2#define _DITTO_DQL_QUERY_RESULT_
4#include "DocumentId.hpp"
12#include <unordered_map>
15typedef struct dittoffi_query_result dittoffi_query_result_t;
16typedef struct dittoffi_query_result_item dittoffi_query_result_item_t;
19using ValueMap = std::unordered_map<std::string, any>;
34 std::shared_ptr<dittoffi_query_result_item> 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<dittoffi_query_result_t> raw;
125 std::vector<QueryResultItem>
items()
const;
Represents the returned results when executing a DQL query, containing a QueryResultItem for each mat...
Definition QueryResult.hpp:104
QueryResultItem get_item(size_t index) const
Returns the matching QueryResultItem.
Definition QueryResult.cpp:21
std::vector< QueryResultItem > items() const
Definition QueryResult.cpp:30
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:41
size_t item_count() const
Definition QueryResult.cpp:17
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:85
std::string json_string() const
Returns the content of the item as a JSON string.
Definition QueryResult.cpp:87
std::shared_ptr< ValueMap > value() const
Returns the content as a materialized value map.
Definition QueryResult.cpp:64
std::vector< uint8_t > cbor_data() const
Returns the content of the item as CBOR data.
Definition QueryResult.cpp:94
bool is_materialized() const
Returns true if value is currently held materialized in memory, otherwise returns false.
Definition QueryResult.cpp:70
void materialize()
Loads the CBOR representation of the item's content, decodes it as a dictionary so it can be accessed...
Definition QueryResult.cpp:77
Provides access to Collections and a write transaction API.
Definition Store.hpp:29
Definition StoreObserver.hpp:44