ClickHouse C – Talk to ClickHouse using its native binary protocol ClickHouse released clickhouse-c, a header-only C client that talks to ClickHouse over its Native binary protocol and Native Format blocks, with no link-time dependencies beyond libc. The library is designed for embedding inside PostgreSQL extensions using palloc arenas and longjmp, and can decode `clickhouse local` output from a pipe without TCP or compression. Users must set `output_format_native_encode_types_in_binary_format = 0` on the server, otherwise `chc_block_read` returns `CHC_ERR_TYPE`. Header-only C client for the ClickHouse https://clickhouse.com/ Native wire format — the Native Protocol https://clickhouse.com/docs/reference/interfaces/specs/NativeProtocol over TCP carrying Native Format https://clickhouse.com/docs/reference/interfaces/specs/NativeFormat blocks. One core header, plus optional follow-up headers for TCP, compression, codecs, and I/O backends. Designed for embedding inside PostgreSQL extensions palloc arena, longjmp but with no PG-specific code. Including clickhouse.h alone gives a pure block decoder over caller-supplied chc io , usable for reading clickhouse-local 's FORMAT Native from a pipe with no TCP, no compression, no link-time deps beyond libc. Decode a clickhouse local query without TCP or compression. / demo.c — cc -std=c11 -O2 -I. demo.c -o demo / define CHC PROVIDE STDLIB ALLOC define CHC IMPLEMENTATION include "clickhouse.h" include "clickhouse-posix-io.h" include