pg_clickhouse (a PostgreSQL foreign data wrapper for ClickHouse) currently maintains two separate protocol implementations: a C++ binary driver wrapping clickhouse-cpp, and a C-based HTTP driver wrapping libcurl. Both implement the same internal interface (connect, query, fetch, insert, stream).
If clickhouse-cpp supported both the native binary protocol and HTTP behind a unified API, it would let us eliminate ~1,500 lines of C HTTP code, get streaming reads on both protocols transparently, and allow per-connection or per-query protocol selection rather than the current per-server toggle.
pg_clickhouse (a PostgreSQL foreign data wrapper for ClickHouse) currently maintains two separate protocol implementations: a C++ binary driver wrapping clickhouse-cpp, and a C-based HTTP driver wrapping libcurl. Both implement the same internal interface (connect, query, fetch, insert, stream).
If clickhouse-cpp supported both the native binary protocol and HTTP behind a unified API, it would let us eliminate ~1,500 lines of C HTTP code, get streaming reads on both protocols transparently, and allow per-connection or per-query protocol selection rather than the current per-server toggle.