1 | #pragma once |
2 | |
3 | #include <cstdint> |
4 | |
5 | #define CLICKHOUSE_DICTIONARY_LIBRARY_API 1 |
6 | |
7 | namespace ClickHouseLibrary |
8 | { |
9 | using CString = const char *; |
10 | using ColumnName = CString; |
11 | using ColumnNames = ColumnName[]; |
12 | |
13 | struct CStrings |
14 | { |
15 | CString * data = nullptr; |
16 | uint64_t size = 0; |
17 | }; |
18 | |
19 | struct VectorUInt64 |
20 | { |
21 | const uint64_t * data = nullptr; |
22 | uint64_t size = 0; |
23 | }; |
24 | |
25 | struct ColumnsUInt64 |
26 | { |
27 | VectorUInt64 * data = nullptr; |
28 | uint64_t size = 0; |
29 | }; |
30 | |
31 | struct Field |
32 | { |
33 | const void * data = nullptr; |
34 | uint64_t size = 0; |
35 | }; |
36 | |
37 | struct Row |
38 | { |
39 | const Field * data = nullptr; |
40 | uint64_t size = 0; |
41 | }; |
42 | |
43 | struct Table |
44 | { |
45 | const Row * data = nullptr; |
46 | uint64_t size = 0; |
47 | uint64_t error_code = 0; // 0 = ok; !0 = error, with message in error_string |
48 | const char * error_string = nullptr; |
49 | }; |
50 | |
51 | enum LogLevel |
52 | { |
53 | FATAL = 1, |
54 | CRITICAL, |
55 | ERROR, |
56 | WARNING, |
57 | NOTICE, |
58 | INFORMATION, |
59 | DEBUG, |
60 | TRACE, |
61 | }; |
62 | |
63 | void log(LogLevel level, CString msg); |
64 | } |
65 | |