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