Awesome ClickHouseC/C++

ClickHouse/clickhouse-cpp

⭐ 382 C repository created 2019-09-12

The project ClickHouse/clickhouse-cpp is a C++ client library designed specifically for interacting with the ClickHouse database. It supports a wide range of ClickHouse data types including arrays, dates, date-times with timezone support, decimals, enums, fixed strings, floats, IP addresses, nullable types, strings, low cardinality strings, tuples, various integer types, UUIDs, maps, and geometric types like points and polygons. The library requires a C++17-compliant compiler, CMake 3.12 or newer, and Ninja for building, with optional dependencies such as OpenSSL, liblz4, libabsl, and libzstd. The repository provides detailed instructions for building the library and integrating it into applications, including an example application that demonstrates creating a table, inserting data, selecting data, and deleting the table using the client. The example also shows how to set up the build system with CMake and how to link the library. The client library is not thread-safe, so separate client instances or synchronization mechanisms are necessary for multi-threaded applications. It also supports retry logic with guidelines on resetting connections and reusing data blocks for inserts. Additionally, the library supports asynchronous inserts with recommendations on settings to ensure reliability and avoid overload, including examples of how to configure asynchronous inserts both in the client and on the ClickHouse server side. Overall, clickhouse-cpp is a comprehensive and robust C++ client for ClickHouse, facilitating efficient and flexible database operations with support for advanced features like asynchronous inserts and detailed type handling, making it suitable for high-performance applications requiring direct interaction with ClickHouse databases.

https://github.com/ClickHouse/clickhouse-cpp

arrayasynchronous-insertsbuildc++-clientc++17clickhouseclickhouse-databaseclient-librarycmakecppdata-typesdatedatetimedecimalenumexample-applicationfixedstringfloatintintegrationipv4ipv6libabslliblz4libzstdlowcardinalitymapmultipolygonninjanullableopensslpointpolygonretriesringstringthread-safetytupleuintuuid