Skip to main content
chDB provides a native C/C++ API for embedding ClickHouse functionality directly into your applications. The API supports both simple queries and advanced features like persistent connections and streaming query results.

Installation

Step 1: Install libchdb

Install the chDB library on your system:

Step 2: Include headers

Include the chDB header in your project:
Compile and link your application with chDB:

C Examples

Basic connection and queries

Streaming queries

Working with different data formats

C++ example

Error handling best practices

GitHub repository

Last modified on July 1, 2026