uClickHouse driver doesn't expose underlying ClickHouse types and only provides a way to convert results to strongly-typed structs/containers (see storages::clickhouse::ExecutionResult).
As naive mapping is ambiguous for some types, namely for chrono and string, explicit mapping is required by the driver - explicit specialization of CppToClickhouse
template.
Supported Clickhouse types:
Example usage:
namespace {
struct Data final {
std::vector<uint64_t> numbers;
std::vector<std::string> strings;
std::vector<uint64_t> other_numbers;
std::vector<std::chrono::system_clock::time_point> tps;
};
struct RowData final {
uint64_t number;
std::string string;
uint64_t other_number;
std::chrono::system_clock::time_point tp;
};
}
template <>
struct CppToClickhouse<Data> final {
using mapped_type =
std::tuple<columns::UInt64Column, columns::StringColumn, columns::UInt64Column, columns::DateTime64ColumnNano>;
};
template <>
struct CppToClickhouse<RowData> final {
using mapped_type =
std::tuple<columns::UInt64Column, columns::StringColumn, columns::UInt64Column, columns::DateTime64ColumnNano>;
};
}