-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathquerying.hpp
50 lines (36 loc) · 929 Bytes
/
querying.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef POSTGRES_PROTOBUF_QUERYING_HPP_
#define POSTGRES_PROTOBUF_QUERYING_HPP_
#include "descriptor_db.hpp"
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
namespace postgres_protobuf {
namespace descriptor_db {
class DescDb;
}
namespace querying {
// TODO: query cache
class BadQuery {
public:
BadQuery(std::string&& msg) : msg(msg) {}
const std::string msg;
};
class RecursionDepthExceeded {};
class QueryImpl;
class Query {
public:
Query(const std::string& query, std::optional<uint64_t> limit);
Query(const Query&) = delete;
void operator=(const Query&) = delete;
~Query();
std::vector<std::string> Run(const std::uint8_t* proto_data,
size_t proto_len);
private:
QueryImpl* impl_;
};
} // namespace querying
} // namespace postgres_protobuf
#endif // POSTGRES_PROTOBUF_QUERYING_HPP_