chDB for Bun
chDB-bun provides experimental FFI (Foreign Function Interface) bindings for chDB, enabling you to run ClickHouse queries directly in your Bun applications with zero external dependencies.
Installation
Step 1: Install system dependencies
First, install the required system dependencies:
Install libchdb
Install build tools
You'll need either gcc
or clang
installed on your system:
Step 2: Install chDB-bun
Usage
chDB-bun supports two query modes: ephemeral queries for one-time operations and persistent sessions for maintaining database state.
Ephemeral queries
For simple, one-off queries that don't require persistent state:
Persistent sessions
For complex operations that require maintaining state across queries: