From b00cf83df9a2f4a3df075fdfd95077edab8f008f Mon Sep 17 00:00:00 2001 From: Shawn Chen Date: Mon, 30 Nov 2026 19:15:59 +1300 Subject: [PATCH 1/3] Update language binding capability matrix for current releases --- README-zh.md | 2 +- README.md | 41 ++--- docs/guides/querying-apache-arrow.mdx | 3 +- docs/index.mdx | 4 + docs/install/bun.mdx | 67 ++++----- docs/install/go.mdx | 81 ++++++---- docs/install/nodejs.mdx | 8 +- docs/install/rust.mdx | 48 +++--- llms-full.txt | 208 ++++++++++++++------------ llms.txt | 6 +- 10 files changed, 264 insertions(+), 204 deletions(-) diff --git a/README-zh.md b/README-zh.md index 51e5ff41ca8..59da57c2399 100644 --- a/README-zh.md +++ b/README-zh.md @@ -34,7 +34,7 @@ ## 安装方式 -目前,chDB 只支持在 macOS(x86_64 和 ARM64)和 Linux 上的 Python 3.9+。 +Python 版 `chdb` 包支持 macOS 和 Linux(x86_64 和 ARM64)上的 Python 3.9+;各语言绑定的已发布版本、Arrow 输入/输出、流式查询、参数绑定和平台限制见[跨语言能力矩阵](README.md#language-binding-capability-matrix)(核查日期:2026-11-30)。矩阵区分稳定包、RC 和仅源码可用的功能;Java/JDBC 1.1.0 已发布至 Maven Central,可选 Arrow 模块仍为实验性;Go 的类型化 Arrow API 需要独立 RC 模块。浏览器中可试用实验性的 [WebAssembly 版本](https://wasm.chdb.io/),它不等同于原生包的全部能力。 ```bash pip install chdb ``` diff --git a/README.md b/README.md index c45070c8700..cdc4eb319a0 100644 --- a/README.md +++ b/README.md @@ -626,30 +626,37 @@ Please refer to [VERSION-GUIDE.md](VERSION-GUIDE.md) for more details. ## Language Binding Capability Matrix -The table below summarizes the user-facing capabilities of the chdb-io language bindings. It uses published versions where available; unreleased main-branch work is called out explicitly. +The table below distinguishes published artifacts, release candidates (RCs), and source-only work. Package versions were checked against their registries, and APIs against release-tagged source; explicitly marked `main` entries describe unreleased code. This is not a claim of feature parity or a fresh end-to-end test of every package. “Source API” means implementation exists but its published-package behavior was not verified. -**Data date:** 2026-09-28 +**Audit date:** 2026-11-30. The native engine column uses the latest stable release, `26.11.1`, not the newer `26.11.2-rc.2` prerelease. Binding and engine versions are independent. -| Capability / dimension | Python
`chdb 4.4.0` | C / C++
`core 26.7.3` | Node.js
`chdb 3.4.0` | Go
`v2.2.0` | Rust
`1.3.1 published / 2.0 main` | Java
`1.0.0-SNAPSHOT` | Ruby
`0.1.0` | .NET
`0.0.3.69` | Bun
`1.1.0 source` | Zig
`0.0.9` | WASM
`0.4.0` | +| Capability / dimension | Python
`chdb 4.5.1` | C / C++
`core 26.11.1` | Node.js
`chdb 3.6.0` | Go
`v2.4.0` + Arrow RC | Rust
`2.2.1` | Java
`1.1.0` | Ruby
`0.2.0` | .NET
`0.0.3.69` + main | Bun
`2.0.0 source` | Zig
`0.0.10 source` | WASM
`0.4.0` | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| Maturity | Stable main package | Core engine | Active release | Active release | 2.0 main, unpublished | Maven WIP | Early | Early | Experimental | Early | Experimental | -| Install / distribution | `pip` | release / bash | npm native packages | `go get` / embedded | Cargo + static; can auto-download `libchdb` | Maven modules; JDBC + native jars WIP | RubyGems | NuGet + manual lib | Source build | Zig package | npm wasm | -| Session / persistent path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Single instance | No real Session | No real Session | Basic connection | Worker connection | -| Durable V1 | Supported | ABI primitives | Supported | Supported | 2.0 main only | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| Arrow output bytes | Supported | Supported | Supported | Supported | Supported | Not supported | Supported | Supported | Incomplete | Limited | Supported | -| Typed Arrow API | `pyarrow.Table` | No language type | `apache-arrow` | Not supported | `RecordBatch` | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| Arrow zero-copy | Partial | C Data API | Input side | Not supported | Supported | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| Arrow input / registration | Python objects | C Data API | register table | Not supported | bulk insert | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| Streaming result | Supported | Supported | Supported | Supported | Supported | Supported | Supported | Not supported | Not supported | Supported | Supported | -| Parameter binding | Basic support | ABI primitives | server-side | Client interpolation | server-side | server-side | Client escaping | Not supported | Not supported | Not supported | Not supported | -| Driver / ecosystem API | DBAPI / ADBC | C ABI | `@clickhouse/client` | `database/sql` | Not supported | JDBC | SQLite style | Not supported | None | None | None | -| Notable feature | DataStore | Embedded C ABI | L3 Kysely-style primitives | SQL driver API | Arrow C Data API | Streaming JDBC ResultSet | Ruby-style DSL | Not supported | Bun FFI | Native Zig wrapper | Browser / Worker | +| Release status | [PyPI](https://pypi.org/project/chdb/4.5.1/) | [native release](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) | [npm](https://www.npmjs.com/package/chdb/v/3.6.0) | [stable module](https://proxy.golang.org/github.com/chdb-io/chdb-go/v2/@v/v2.4.0.info); separate [Arrow RC](https://proxy.golang.org/github.com/chdb-io/chdb-go/v2/arrow/@v/v0.1.0-rc.1.info) | [crates.io](https://crates.io/crates/chdb-rust/2.2.1); experimental API | [Maven Central GA](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/); Arrow module experimental | [RubyGems](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) | [NuGet](https://www.nuget.org/packages/chdb/0.0.3.69); newer main is not that package | [GitHub v2.0.0](https://github.com/chdb-io/chdb-bun/releases/tag/v2.0.0); npm still 1.0.4 | [source tag](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10); runtime not revalidated here | [npm](https://www.npmjs.com/package/chdb-wasm/v/0.4.0), experimental | +| Install / distribution | `pip` | Native release assets | npm platform packages; core 26.11.1 bundled | `go get` + installed or opt-in embedded engine; Arrow separate | Cargo; auto-downloads core 26.11.1, or custom dynamic/static library | Central driver + platform native JAR; optional `chdb-arrow` | Native extension compiled and engine downloaded at install | Published package needs native lib; main adds platform runtime packages | Source build + Clang; core 26.11.0-rc.2 | Zig 0.15.2+; Linux x86_64/aarch64 build targets | npm WebAssembly; browser or Node 23+ Worker | +| Session / persistent path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Single database instance | Published path wrapper; main retains per-session connections | Source: one shared native connection, reused per active path | Source connection / path API | Worker-local paths; no verified reload persistence | +| Durable V1 | Supported | ABI primitives | Experimental adapter + native engine | Adapter requires compatible native ABI | Opt-in `durable` / `durable-s3` features | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | +| Arrow IPC output bytes | Supported | Supported | Supported; distinct from direct Arrow | Supported in root module | Supported; distinct from direct Arrow | No dedicated IPC API; direct Arrow module instead | Supported | Source API; published package unverified | No binary-safe API | No selectable Arrow format (fixed JSONEachRow) | Arrow IPC format not verified here | +| Typed Arrow API | `Table` / `RecordBatch` | C structs, no language type | `apache-arrow` Table / RecordBatch | Optional Arrow RC: Table / RecordBatch | Arrow 59 `RecordBatch` | Optional module: `VectorSchemaRoot` / `ArrowReader` | Not supported | Not supported | Not supported | Not supported | Not supported | +| Direct Arrow C Data / Stream (no IPC) | Supported with core 26.11.1+ | Supported | Supported; input/output conversions copy | Optional Arrow RC; input copied to native memory | Supported; conversions may copy | Optional experimental module; conversions may copy | Not supported | Not supported | Not supported | Not supported | Native C Data API not exposed | +| Arrow input / registration | `Python(...)`, scoped registration and insert | C Data / Stream registration and insert | Table / batch / async reader registration and insert | Optional Arrow RC: batch / reader scan and insert | Scoped reader registration and direct batch / reader insert | Optional module: batch / owned-reader registration and insert | Not supported | Not supported | Not supported | Not supported | Not supported | +| Streaming result | Formatted chunks and direct Arrow batches | Formatted chunks and Arrow batches | Async chunks and direct Arrow batches; one active stream/session | Formatted chunks; typed batches via Arrow RC | Formatted chunks, Arrow batches; streaming insert | Forward-only JDBC `ResultSet`; Arrow batch reader | Chunked query / fetch / cancel API | Not supported | Not supported | Chunked fetch / cancel API (source) | Async worker result chunks | +| Parameter binding | Named engine parameters | Named ABI | Native named parameters, including direct Arrow queries | Stable: driver interpolation; root RC adds native named parameters | Native named parameters across query / stream / insert | JDBC `PreparedStatement`; named parameters on streaming Arrow queries | Client SQL interpolation | Not supported | Not supported | Not supported | Not supported | +| Driver / ecosystem API | DBAPI / ADBC | C ABI | Experimental `@clickhouse/client` adapter | `database/sql` (no transactions/prepared statements) | No standard database driver in this crate | JDBC; Arrow module is not Java ADBC | SQLite-style API | No ADO.NET provider | None | None | None | **Session boundary:** chdb-core allows only one active data path per process. "Multi-connection same path" means a binding can open multiple connections on the same data path; concurrent different data paths are uniformly unsupported and require closing before switching. -**Arrow implementation differences:** Python and Node primarily expose Arrow IPC bytes and then convert into language objects. Go raw queries can request Arrow output bytes, but its `database/sql` row path is Parquet-based rather than a typed Arrow API. Rust 2.0 main uses the Arrow C Data Interface, can stream `RecordBatch` values directly, and supports Arrow bulk insert. Java V1 currently uses `RowBinaryWithNamesAndTypes` decoded into JDBC `ResultSet` and does not expose an Arrow Java API. +**Arrow implementation differences:** Python 4.5.1 and Node 3.6.0 now expose direct typed Arrow results alongside their existing IPC output. Rust 2.2.1 supports direct result batches, scoped reader input and bulk insert. Go's separately published Arrow RC and Java's optional `chdb-arrow` module also provide C Data/C Stream input, typed output and insert. These are distinct from Go's Parquet-based `database/sql` rows and Java's `RowBinaryWithNamesAndTypes` JDBC `ResultSet`. **Avoiding IPC is not an end-to-end zero-copy guarantee:** conversion, ownership transfer and language-specific buffer copies still apply. Supported types and one-shot reader lifetimes differ; consult the binding guides linked below. -**Streaming note:** The user-facing stream differs by binding. Go streams formatted result chunks and its SQL driver reads Parquet chunks; Rust can consume result streams, Arrow batch streams, and streaming inserts; Java exposes a forward-only JDBC `ResultSet`; Node/WASM expose async streams; Ruby/Zig expose chunked fetch APIs at the binding layer. +**Feature flags and engine ABI:** Rust enables `arrow` by default; Durable V1 and S3 storage require opt-in `durable` and `durable-s3` features. Go's stable root module remains Go 1.21 and cgo-free. Its Arrow module `github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1` requires Go 1.23+, cgo, root bindings `v2.5.0-rc.2`, and a native Arrow ABI from core `26.11.0-rc.3` or newer. The same root RC adds native named parameters, including `sql.Named`; stable v2.4.0's positional driver arguments are interpolated. The installed engine, embedded engine module, Arrow module, and experimental static engine module are separately selected/versioned; installing the root module alone does not enable them. Go Durable V1 also requires a compatible native ABI. + +**Java release boundary:** `com.clickhouse.chdb` 1.1.0 is available from Maven Central: the JDBC driver, optional Arrow module and four Linux/macOS x86_64/arm64 native packages have published POMs. The JDBC, Arrow and macOS arm64 native JARs were also checked for availability. Keep all artifacts on the same binding version; they bundle core 26.11.1. Some repository READMEs still describe the earlier RC/publication gate. Ordinary JDBC is now GA; the optional Arrow module remains experimental, requires Arrow's JVM access flag, and uses a separate connection rather than exporting an existing `ResultSet`. Neither JDBC transactions nor batch updates are supported. + +**Source and cleanup caveats:** Bun 2.0.0 is a source release, not npm 1.0.4: its native wrapper now reuses a connection for the active path, but `cleanup()` still deletes the supplied directory. Go's `Cleanup()` also deletes the data path when the last session closes; use `Close()` to preserve caller-owned data. .NET's newer [main source](https://github.com/chdb-io/chdb-dotnet/tree/88d9e6948e7dd95b4e14de5175713d0db1eb81ab) retains per-session native connections and defines runtime packages, but NuGet still serves 0.0.3.69; do not attribute those changes to that published package. Zig 0.0.10 updates the native ABI and build to Zig 0.15.2 with Linux-only build targets; its source includes chunked streaming and typed JSON row decoding, not typed Arrow. Neither its native build nor every language's runtime suite was rerun for this documentation audit. + +**WASM boundary:** npm still publishes 0.4.0, while the separate browser shell pins 0.3.0. The published 0.4.0 API exposes Worker-based queries, explicit connections, byte results, chunked streams and file registration; it has no native parameter-binding or typed Arrow interface. A path inside its in-memory filesystem is not verified persistence across page reloads, and neither the shell nor the package implies parity with the native engine. + +**API evidence and usage guides:** [Python 4.5.1 direct Arrow](https://github.com/chdb-io/chdb/blob/v4.5.1/docs/python-arrow-direct.md), [Node 3.6.0 Arrow APIs](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md), [Go Arrow RC](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md), [Go RC native parameter implementation](https://github.com/chdb-io/chdb-go/blob/v2.5.0-rc.2/chdb/driver/driver.go), [Rust 2.2.1 Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md), [Java 1.1.0 installation](https://github.com/chdb-io/chdb-java/blob/v1.1.0/docs/releases/1.1.0.md) and [Arrow module](https://github.com/chdb-io/chdb-java/blob/v1.1.0/chdb-arrow/README.md), [Ruby 0.2.0 streaming implementation](https://github.com/chdb-io/chdb-ruby/blob/v0.2.0/ext/chdb/connection.c), [Bun 2.0.0 connection implementation](https://github.com/chdb-io/chdb-bun/blob/v2.0.0/lib/chdb_bun.c), [Zig 0.0.10 implementation](https://github.com/chdb-io/chdb-zig/blob/0.0.10/src/chdb.zig), and [published WASM 0.4.0 API](https://unpkg.com/chdb-wasm@0.4.0/dist/async.d.ts). **Notable feature note:** Python DataStore is a pandas-like lazy execution data layer; Node L3 Kysely-style primitives target typed SQL builder use cases; Go's SQL driver API means it integrates with the standard Go `database/sql` package; Rust's Arrow C Data API means Arrow is a first-class data path, not just an output bytes format. diff --git a/docs/guides/querying-apache-arrow.mdx b/docs/guides/querying-apache-arrow.mdx index ba8e014ddf8..b2bcb291cc7 100644 --- a/docs/guides/querying-apache-arrow.mdx +++ b/docs/guides/querying-apache-arrow.mdx @@ -17,11 +17,12 @@ An Arrow `Table` holds batches of columnar data; a `RecordBatchReader` supplies | --- | --- | | Query an in-memory `pyarrow.Table` or one-shot `RecordBatchReader` | This guide's [`Python(arrow_table)` example](#querying-apache-arrow); [core reader behavior tests](https://github.com/chdb-io/chdb-core/blob/main/tests/test_arrow_c_stream_protocol.py) for one-shot streams | | Install chDB and use the existing `ArrowTable` or streaming result formats | [Python installation and examples](/chdb/install/python); [Python API reference](/chdb/api/python) | +| Use direct typed results, incremental batches, scoped registration or bulk insert without IPC | [Python 4.5.1 direct Arrow guide](https://github.com/chdb-io/chdb/blob/v4.5.1/docs/python-arrow-direct.md): `query_arrow`, `query_arrow_batches`, and `chdb.arrow.connect()`; requires core 26.11.1+ | | Use Arrow with the pandas-like DataStore layer | [DataStore I/O](/chdb/datastore/io) and [class reference](/chdb/datastore/class-reference) — a separate API from `Python(tbl)` | | Use Arrow Database Connectivity (ADBC), the standard database-driver API for Arrow results or bulk ingest | [ADBC installation and usage](https://clickhouse.com/docs/chdb/install/adbc); ordinary ADBC `BindStream` passes query parameters, not a temporary SQL table like `Python(tbl)` | | Work on the native Arrow contract or C examples | [Binding contract](https://github.com/chdb-io/chdb-core/blob/main/docs/NATIVE_ARROW_BINDING_CONTRACT.md), [input example](https://github.com/chdb-io/chdb-core/blob/main/examples/chdbArrowTest.c), [query-output example](https://github.com/chdb-io/chdb-core/blob/main/examples/chdbArrowQueryTest.c) | -This is the Python binding's Arrow documentation entry point. `ArrowTable`/`Arrow` result formats serialize Arrow data using its Inter-Process Communication (IPC) format; the pandas-like DataStore Arrow interface is another API. Consult their linked guides rather than assuming identical streaming or ownership behavior. +This is the Python binding's Arrow documentation entry point. `ArrowTable`/`Arrow` result formats serialize Arrow data using its Inter-Process Communication (IPC) format. Python 4.5.1 also exposes direct C Data results through `query_arrow` and `query_arrow_batches`; conversion may still copy data, and partial batch streams must be closed. The pandas-like DataStore Arrow interface and ADBC driver are separate APIs. Consult their linked guides rather than assuming identical streaming or ownership behavior. ## Setup {#setup} diff --git a/docs/index.mdx b/docs/index.mdx index e7799299fd9..b124736a388 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -73,6 +73,10 @@ chDB has the following language bindings: * [Bun](/chdb/install/bun) * [C and C++](/chdb/install/c) +As of November 30, 2026, the checked published versions are Python `4.5.1`, Node.js `3.6.0`, Go `v2.4.0`, Rust `2.2.1`, and native core `26.11.1`. [Java/JDBC `1.1.0`](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/) is now available from Maven Central with platform-native JARs; its optional `chdb-arrow` module remains experimental. Go's typed Arrow APIs are in the independently published `v0.1.0-rc.1` Arrow module, which requires root bindings `v2.5.0-rc.2`, cgo and a compatible engine; they are not enabled by installing stable Go `v2.4.0` alone. + +[Ruby `0.2.0`](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) includes chunked streaming. [Bun `2.0.0`](https://github.com/chdb-io/chdb-bun/releases/tag/v2.0.0) and [Zig `0.0.10`](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10) have source releases; npm `chdb-bun` remains `1.0.4`, and Zig's current build targets are Linux x86_64/aarch64. [.NET's published `0.0.3.69`](https://www.nuget.org/packages/chdb/0.0.3.69) does not include its newer main-branch session/runtime-packaging work. These clients are not feature-equivalent. The [browser WebAssembly build](https://wasm.chdb.io/) remains experimental, and its shell pins `0.3.0` while npm publishes `0.4.0`. + ## How do I get started? {#how-do-i-get-started} * If you're using [Go](/chdb/install/go), [Rust](/chdb/install/rust), [NodeJS](/chdb/install/nodejs), [Bun](/chdb/install/bun) or [C and C++](/chdb/install/c), take a look at the corresponding language pages. diff --git a/docs/install/bun.mdx b/docs/install/bun.mdx index 802cfc1b4ac..eaf36e37369 100644 --- a/docs/install/bun.mdx +++ b/docs/install/bun.mdx @@ -7,7 +7,7 @@ keywords: ['chdb', 'bun', 'javascript', 'typescript', 'embedded', 'clickhouse', doc_type: 'guide' --- -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. +chDB-bun provides experimental FFI (Foreign Function Interface) bindings for in-process ClickHouse queries from Bun. As of November 30, 2026, GitHub has a `v2.0.0` source release, while npm `chdb-bun` still serves `1.0.4`; these are not the same implementation. The source release uses native core `26.11.0-rc.2` and requires build tools. It does not expose binary-safe Arrow results, typed Arrow, streaming results or native parameter binding. ## Installation {#installation} @@ -18,45 +18,43 @@ First, install the required system dependencies: #### Install libchdb {#install-libchdb} -```bash -curl -sL https://lib.chdb.io | bash -``` +The source build's `lib/update_libchdb.sh` downloads core `v26.11.0-rc.2` from [chdb-core releases](https://github.com/chdb-io/chdb-core/releases). A separately installed system library is not a substitute for checking which library the built FFI wrapper actually loads. #### Install build tools {#install-build-tools} -You'll need either `gcc` or `clang` installed on your system: +The source build script invokes `clang`; install Clang on a supported macOS or Linux host. -```bash -# Install from the GitHub repository -bun add github:chdb-io/chdb-bun +The GitHub `v2.0.0` release is a source build; a standalone `bun add github:...` does not install/build the native `.so` file used by its FFI entry point. Clone the audited tag and build it locally: -# Or clone and build locally -git clone https://github.com/chdb-io/chdb-bun.git +```bash +git clone --branch v2.0.0 --depth 1 https://github.com/chdb-io/chdb-bun.git cd chdb-bun bun install bun run build ``` +Run the examples below from the built source directory; they import `./index.ts`. The separately published npm `chdb-bun` package currently has a different version (`1.0.4`) and is not the source version described here. + ## Usage {#usage} -chDB-bun supports two query modes: ephemeral queries for one-time operations and persistent sessions for maintaining database state. +chDB-bun supports one-off queries and a path-based `Session` wrapper. In `v2.0.0`, the native wrapper keeps one shared connection open while the active path stays the same. Switching paths closes that connection and opens another; separate `Session` objects do not each own an independent native connection. `cleanup()` closes the matching connection and recursively deletes the supplied data directory. ### Ephemeral queries {#ephemeral-queries} For simple, one-off queries that don't require persistent state: ```typescript -import { query } from 'chdb-bun'; +import { query } from './index.ts'; // Basic query const result = query("SELECT version()", "CSV"); -console.log(result); // "23.10.1.1" +console.log(result); // Version of the loaded native engine // Query with different output formats const jsonResult = query("SELECT 1 as id, 'Hello' as message", "JSON"); @@ -76,51 +74,48 @@ console.log(systemInfo); For complex operations that require maintaining state across queries: ```typescript -import { Session } from 'chdb-bun'; +import { Session } from './index.ts'; // Create a session with persistent storage const sess = new Session('./chdb-bun-tmp'); -try { - // Create a database and table - sess.query(` +// Create a database and table +sess.query(` CREATE DATABASE IF NOT EXISTS mydb; CREATE TABLE IF NOT EXISTS mydb.users ( id UInt32, name String, email String ) ENGINE = MergeTree() ORDER BY id - `, "CSV"); +`, "CSV"); - // Insert data - sess.query(` +// Insert data +sess.query(` INSERT INTO mydb.users VALUES (1, 'Alice', 'alice@example.com'), (2, 'Bob', 'bob@example.com'), (3, 'Charlie', 'charlie@example.com') - `, "CSV"); +`, "CSV"); - // Query the data - const users = sess.query("SELECT * FROM mydb.users ORDER BY id", "JSON"); - console.log("Users:", users); +// Query the data +const users = sess.query("SELECT * FROM mydb.users ORDER BY id", "JSON"); +console.log("Users:", users); - // Create and use custom functions - sess.query("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'Hello chDB'", "CSV"); - const greeting = sess.query("SELECT hello() as message", "Pretty"); - console.log(greeting); +// Create and use custom functions +sess.query("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'Hello chDB'", "CSV"); +const greeting = sess.query("SELECT hello() as message", "Pretty"); +console.log(greeting); - // Aggregate queries - const stats = sess.query(` +// Aggregate queries +const stats = sess.query(` SELECT COUNT(*) as total_users, MAX(id) as max_id, MIN(id) as min_id FROM mydb.users - `, "JSON"); - console.log("Statistics:", stats); +`, "JSON"); +console.log("Statistics:", stats); -} finally { - // Always cleanup the session to free resources - sess.cleanup(); // This deletes the database files -} +// Keep the persistent database path. sess.cleanup() recursively deletes it; +// use cleanup() only when you intentionally want to discard this data. ``` diff --git a/docs/install/go.mdx b/docs/install/go.mdx index 8d58c33cdb8..53558c337af 100644 --- a/docs/install/go.mdx +++ b/docs/install/go.mdx @@ -7,18 +7,14 @@ keywords: ['chdb', 'go', 'golang', 'embedded', 'clickhouse', 'sql', 'olap'] doc_type: 'guide' --- -chDB-go provides Go bindings for chDB, enabling you to run ClickHouse queries directly in your Go applications with zero external dependencies. +chDB-go runs ClickHouse queries in-process from Go without a separate database server. It still requires a compatible native chDB library, either installed separately or supplied by a supported embedded-library module. ## Installation {#installation} -First, install the chDB library: - -```bash -curl -sL https://lib.chdb.io | bash -``` +The published stable Go `v2.4.0` module is versioned separately from the native library. Install a compatible release from [chdb-core](https://github.com/chdb-io/chdb-core/releases), or opt into the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded) on a supported platform. The `https://lib.chdb.io` convenience installer fetches a moving latest version and does not pin it to this guide's Go module; verify the selected native version, especially before using Durable V1 or Arrow. @@ -26,33 +22,45 @@ curl -sL https://lib.chdb.io | bash Install the Go package: ```bash -go install github.com/chdb-io/chdb-go@latest +go install github.com/chdb-io/chdb-go/v2@v2.4.0 ``` Or add it to your `go.mod`: ```bash -go get github.com/chdb-io/chdb-go +go get github.com/chdb-io/chdb-go/v2@v2.4.0 ``` +### Optional Arrow and native parameter APIs {#optional-arrow} + +As of November 30, 2026, typed Arrow input/output is a separately published release candidate, not part of the stable root module's default API: + +```bash +go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 +``` + +This selects root bindings `v2.5.0-rc.2` and requires Go 1.23+, cgo, and a native engine with the Arrow C ABI (`26.11.0-rc.3` or newer; stable `26.11.1` is available). The optional module supports batch/reader input, typed tables and incremental batches, and bulk insert. It exchanges C Data/C Stream rather than IPC; input is copied into native-owned memory. The ordinary root module remains Go 1.21 and cgo-free. See the [Arrow module guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for installation, APIs and resource lifetimes. + +Stable `v2.4.0` uses client-side interpolation for positional `database/sql` arguments. The root `v2.5.0-rc.2` adds native named parameters (`{name:Type}`, including `sql.Named`); neither form adds transactions or prepared statements. An embedded engine import does not by itself guarantee the newer Arrow/parameter ABI. Static engine distribution is also a [separate experimental module](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md), not the default embedded-library path. + ## Usage {#usage} ### Command line interface {#cli} -chDB-go includes a CLI for quick queries: +chDB-go includes a CLI for quick queries. After `go install`, use `chdb-go` if Go's binary directory is on `PATH`; `./chdb-go` only applies when you built the executable in the current directory. ```bash # Simple query -./chdb-go "SELECT 123" +chdb-go "SELECT 123" # Interactive mode -./chdb-go +chdb-go # Interactive mode with persistent storage -./chdb-go --path /tmp/chdb +chdb-go --path /tmp/chdb ``` ### Go Library - quick start {#quick-start} @@ -66,7 +74,7 @@ package main import ( "fmt" - "github.com/chdb-io/chdb-go/chdb" + "github.com/chdb-io/chdb-go/v2/chdb" ) func main() { @@ -75,6 +83,7 @@ func main() { if err != nil { panic(err) } + defer result.Free() fmt.Println(result) } ``` @@ -88,7 +97,7 @@ package main import ( "fmt" - "github.com/chdb-io/chdb-go/chdb" + "github.com/chdb-io/chdb-go/v2/chdb" ) func main() { @@ -97,37 +106,48 @@ func main() { if err != nil { panic(err) } - defer session.Cleanup() + defer session.Close() // Preserve /tmp/chdb-data; Cleanup() deletes the data path. // Create database and table - _, err = session.Query(` - CREATE DATABASE IF NOT EXISTS testdb; + created, err := session.Query("CREATE DATABASE IF NOT EXISTS testdb") + if err != nil { + panic(err) + } + if created != nil { + created.Free() + } + + table, err := session.Query(` CREATE TABLE IF NOT EXISTS testdb.test_table ( id UInt32, name String ) ENGINE = MergeTree() ORDER BY id - `, "") - + `) if err != nil { panic(err) } + if table != nil { + table.Free() + } // Insert data - _, err = session.Query(` + inserted, err := session.Query(` INSERT INTO testdb.test_table VALUES (1, 'Alice'), (2, 'Bob'), (3, 'Charlie') - `, "") - + `) if err != nil { panic(err) } + if inserted != nil { + inserted.Free() + } // Query data result, err := session.Query("SELECT * FROM testdb.test_table ORDER BY id", "Pretty") if err != nil { panic(err) } - + defer result.Free() fmt.Println(result) } ``` @@ -142,7 +162,7 @@ package main import ( "database/sql" "fmt" - _ "github.com/chdb-io/chdb-go/chdb/driver" + _ "github.com/chdb-io/chdb-go/v2/chdb/driver" ) func main() { @@ -168,6 +188,9 @@ func main() { } fmt.Printf("Count: %d\n", count) } + if err := rows.Err(); err != nil { + panic(err) + } } ``` @@ -181,7 +204,7 @@ package main import ( "fmt" "log" - "github.com/chdb-io/chdb-go/chdb" + "github.com/chdb-io/chdb-go/v2/chdb" ) func main() { @@ -190,10 +213,10 @@ func main() { if err != nil { log.Fatal(err) } - defer session.Cleanup() + defer session.Close() // Preserve /tmp/chdb-stream; Cleanup() deletes the data path. // Execute a streaming query for large dataset - streamResult, err := session.QueryStreaming( + streamResult, err := session.QueryStream( "SELECT number, number * 2 as double FROM system.numbers LIMIT 1000000", "CSV", ) @@ -242,8 +265,8 @@ func main() { chDB-go provides both high-level and low-level APIs: -- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/chdb.md)** - Recommended for most use cases -- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/lowApi.md)** - For advanced use cases requiring fine-grained control +- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/chdb.md)** - Recommended for most use cases +- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/lowApi.md)** - For advanced use cases requiring fine-grained control ## System requirements {#requirements} diff --git a/docs/install/nodejs.mdx b/docs/install/nodejs.mdx index 16bbdbd17c3..24f7dc279da 100644 --- a/docs/install/nodejs.mdx +++ b/docs/install/nodejs.mdx @@ -7,7 +7,9 @@ keywords: ['chdb', 'nodejs', 'javascript', 'embedded', 'clickhouse', 'sql', 'ola doc_type: 'guide' --- -chDB-node provides Node.js bindings for chDB, enabling you to run ClickHouse queries directly in your Node.js applications with zero external dependencies. +chDB-node runs ClickHouse queries in-process from Node.js without a separate database server. The npm package uses native, platform-specific libraries; check its supported platforms before installing. + +As of November 30, 2026, npm publishes `chdb@3.6.0` with native core `26.11.1` packages for Linux glibc and macOS, on x64/arm64; Node.js 18+ is required. In addition to the synchronous examples below, it provides asynchronous queries, native named parameters, formatted result streams and direct Arrow APIs. With the optional `apache-arrow` peer, applications can register tables/batches/readers, read typed tables or incremental batches, and bulk-insert Arrow data through C Data/C Stream. The existing `format: 'arrow'` / `toArrow()` route still uses IPC, and direct Arrow can still copy buffers. See the [3.6.0 Arrow guide](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md) for types, cancellation and cleanup rules. The `chdb/connection` ClickHouse-client adapter and Durable APIs remain experimental. ## Installation {#installation} @@ -89,8 +91,8 @@ try { console.log("User Statistics:", stats); } finally { - // Always cleanup the session - session.cleanup(); // This deletes the database files + // Close the native connection. A caller-supplied database path is preserved. + session.cleanup(); } ``` diff --git a/docs/install/rust.mdx b/docs/install/rust.mdx index 78b8370a3d1..86c64f6e46a 100644 --- a/docs/install/rust.mdx +++ b/docs/install/rust.mdx @@ -2,23 +2,28 @@ title: 'Installing chDB for Rust' sidebarTitle: 'Rust' slug: /install/rust -description: 'How to install and use chDB Rust bindingsd' +description: 'How to install and use chDB Rust bindings' keywords: ['chdb', 'embedded', 'clickhouse-lite', 'rust', 'install', 'ffi', 'bindings'] doc_type: 'guide' --- -chDB-rust provides experimental FFI (Foreign Function Interface) bindings for chDB, enabling you to run ClickHouse queries directly in your Rust applications with zero external dependencies. +chDB-rust provides FFI (Foreign Function Interface) bindings for in-process ClickHouse queries without a separate database server. The crate has Rust dependencies and needs a compatible native chDB library at link or runtime. ## Installation {#installation} -### Install libchdb {#install-libchdb} +### Add the crate {#add-crate} -Install the chDB library: +Add the published `2.2.1` crate to your application's `Cargo.toml` (checked November 30, 2026). The binding still labels its API experimental: -```bash -curl -sL https://lib.chdb.io | bash +```toml +[dependencies] +chdb-rust = "=2.2.1" ``` +On supported Linux/macOS x86_64 and aarch64 targets, the build uses a compatible locally installed `libchdb` and header, or downloads its pinned stable engine version (`v26.11.1`). Generating FFI bindings also requires the Clang/libclang toolchain. To select a local library explicitly, set `CHDB_LIB_DIR` and `CHDB_INCLUDE_DIR`. A system installer that fetches the newest native engine is not necessarily pinned to the version used by this crate. For a dynamically linked binary distributed outside `cargo run`, configure its runtime library path or ship `libchdb` beside it with an appropriate rpath; alternatively, opt into the `static` feature. + +The default `arrow` feature uses Arrow 59 and provides direct C Data/C Stream results, incremental `RecordBatch` output, scoped reader registration, and batch/reader insertion. Existing Arrow IPC output is a separate path; direct Arrow does not guarantee zero-copy conversion. See the [Rust Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md) for supported types and ownership. Native named query parameters also work across buffered queries, result streams, Arrow streams and inserts. Durable V1 and its S3 backend remain opt-in through the `durable` and `durable-s3` features. + ## Usage {#usage} chDB Rust provides both stateless and stateful query execution modes. @@ -38,7 +43,7 @@ fn main() -> Result<(), Box> { )?; println!("ClickHouse version: {}", result.data_utf8()?); - // Query with CSV file + // Query a CSV file if data.csv exists in the working directory let result = execute( "SELECT * FROM file('data.csv', 'CSV')", Some(&[Arg::OutputFormat(OutputFormat::JSONEachRow)]) @@ -51,7 +56,7 @@ fn main() -> Result<(), Box> { ### Stateful usage (Sessions) {#stateful-usage-sessions} -For queries requiring persistent state like databases and tables: +For queries that maintain state across calls, the example below uses a temporary directory. Add `tempdir = "0.3.7"` to your application's dependencies. The opt-in `with_auto_cleanup(true)` deletes that directory after the final handle closes; use a caller-owned path without auto-cleanup if the data must survive the process. ```rust use chdb_rust::{ @@ -70,29 +75,25 @@ fn main() -> Result<(), Box> { let session = SessionBuilder::new() .with_data_path(tmp.path()) .with_arg(Arg::LogLevel(LogLevel::Debug)) - .with_auto_cleanup(true) // Cleanup on drop + .with_auto_cleanup(true) // Delete this temporary data directory on drop .build()?; // Create database and table + session.execute("CREATE DATABASE demo", None)?; session.execute( - "CREATE DATABASE demo; USE demo", - Some(&[Arg::MultiQuery]) - )?; - - session.execute( - "CREATE TABLE logs (id UInt64, msg String) ENGINE = MergeTree() ORDER BY id", + "CREATE TABLE demo.logs (id UInt64, msg String) ENGINE = MergeTree() ORDER BY id", None, )?; // Insert data session.execute( - "INSERT INTO logs (id, msg) VALUES (1, 'Hello'), (2, 'World')", + "INSERT INTO demo.logs (id, msg) VALUES (1, 'Hello'), (2, 'World')", None, )?; // Query data let result = session.execute( - "SELECT * FROM logs ORDER BY id", + "SELECT * FROM demo.logs ORDER BY id", Some(&[Arg::OutputFormat(OutputFormat::JSONEachRow)]), )?; @@ -121,12 +122,9 @@ cargo build cargo test ``` -### Development dependencies {#development-dependencies} +### Dependency categories {#dependency-categories} -The project includes these development dependencies: -- `bindgen` (v0.70.1) - Generate FFI bindings from C headers -- `tempdir` (v0.3.7) - Temporary directory handling in tests -- `thiserror` (v1) - Error handling utilities +The crate uses `bindgen` to generate FFI bindings during its build and `thiserror` as a regular dependency. `tempdir` is only a development dependency of the crate, so applications using the temporary-session example above must add it explicitly. ## Error handling {#error-handling} @@ -135,9 +133,10 @@ chDB Rust provides comprehensive error handling through the `Error` enum: ```rust use chdb_rust::{execute, error::Error}; -match execute("SELECT 1", None) { +fn main() { + match execute("SELECT 1", None) { Ok(result) => { - println!("Success: {}", result.data_utf8()?); + println!("Success: {}", result.data_utf8_lossy()); }, Err(Error::QueryError(msg)) => { eprintln!("Query failed: {}", msg); @@ -151,6 +150,7 @@ match execute("SELECT 1", None) { Err(e) => { eprintln!("Other error: {}", e); } + } } ``` diff --git a/llms-full.txt b/llms-full.txt index ea6738db9a8..f661af72cd9 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -20,7 +20,7 @@ This file contains the full chDB documentation corpus. The companion index is at # chDB -**URL:** https://clickhouse.com/docs/chdb +**URL:** https://clickhouse.com/docs/chdb/ chDB is an in-process SQL OLAP Engine powered by ClickHouse @@ -82,6 +82,10 @@ chDB has the following language bindings: * [Bun](https://clickhouse.com/docs/chdb/install/bun) * [C and C++](https://clickhouse.com/docs/chdb/install/c) +As of November 30, 2026, the checked published versions are Python `4.5.1`, Node.js `3.6.0`, Go `v2.4.0`, Rust `2.2.1`, and native core `26.11.1`. [Java/JDBC `1.1.0`](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/) is now available from Maven Central with platform-native JARs; its optional `chdb-arrow` module remains experimental. Go's typed Arrow APIs are in the independently published `v0.1.0-rc.1` Arrow module, which requires root bindings `v2.5.0-rc.2`, cgo and a compatible engine; they are not enabled by installing stable Go `v2.4.0` alone. + +[Ruby `0.2.0`](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) includes chunked streaming. [Bun `2.0.0`](https://github.com/chdb-io/chdb-bun/releases/tag/v2.0.0) and [Zig `0.0.10`](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10) have source releases; npm `chdb-bun` remains `1.0.4`, and Zig's current build targets are Linux x86_64/aarch64. [.NET's published `0.0.3.69`](https://www.nuget.org/packages/chdb/0.0.3.69) does not include its newer main-branch session/runtime-packaging work. These clients are not feature-equivalent. The [browser WebAssembly build](https://wasm.chdb.io/) remains experimental, and its shell pins `0.3.0` while npm publishes `0.4.0`. + ## How do I get started? * If you're using [Go](https://clickhouse.com/docs/chdb/install/go), [Rust](https://clickhouse.com/docs/chdb/install/rust), [NodeJS](https://clickhouse.com/docs/chdb/install/nodejs), [Bun](https://clickhouse.com/docs/chdb/install/bun) or [C and C++](https://clickhouse.com/docs/chdb/install/c), take a look at the corresponding language pages. * If you're using Python, see the [getting started developer guide](https://clickhouse.com/docs/chdb/getting-started) or the [chDB on-demand course](https://learn.clickhouse.com/user_catalog_class/show/1901178). @@ -519,7 +523,7 @@ To learn more about how to use it, see the following developer guides: How to install and use chDB with Bun runtime -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. +chDB-bun provides experimental FFI (Foreign Function Interface) bindings for in-process ClickHouse queries from Bun. As of November 30, 2026, GitHub has a `v2.0.0` source release, while npm `chdb-bun` still serves `1.0.4`; these are not the same implementation. The source release uses native core `26.11.0-rc.2` and requires build tools. It does not expose binary-safe Arrow results, typed Arrow, streaming results or native parameter binding. ## Installation @@ -528,32 +532,30 @@ chDB-bun provides experimental FFI (Foreign Function Interface) bindings for chD First, install the required system dependencies: #### Install libchdb -```bash -curl -sL https://lib.chdb.io | bash -``` +The source build's `lib/update_libchdb.sh` downloads core `v26.11.0-rc.2` from [chdb-core releases](https://github.com/chdb-io/chdb-core/releases). A separately installed system library is not a substitute for checking which library the built FFI wrapper actually loads. #### Install build tools -You'll need either `gcc` or `clang` installed on your system: +The source build script invokes `clang`; install Clang on a supported macOS or Linux host. -```bash -# Install from the GitHub repository -bun add github:chdb-io/chdb-bun +The GitHub `v2.0.0` release is a source build; a standalone `bun add github:...` does not install/build the native `.so` file used by its FFI entry point. Clone the audited tag and build it locally: -# Or clone and build locally -git clone https://github.com/chdb-io/chdb-bun.git +```bash +git clone --branch v2.0.0 --depth 1 https://github.com/chdb-io/chdb-bun.git cd chdb-bun bun install bun run build ``` +Run the examples below from the built source directory; they import `./index.ts`. The separately published npm `chdb-bun` package currently has a different version (`1.0.4`) and is not the source version described here. + ## Usage -chDB-bun supports two query modes: ephemeral queries for one-time operations and persistent sessions for maintaining database state. +chDB-bun supports one-off queries and a path-based `Session` wrapper. In `v2.0.0`, the native wrapper keeps one shared connection open while the active path stays the same. Switching paths closes that connection and opens another; separate `Session` objects do not each own an independent native connection. `cleanup()` closes the matching connection and recursively deletes the supplied data directory. ### Ephemeral queries For simple, one-off queries that don't require persistent state: @@ -562,7 +564,7 @@ For simple, one-off queries that don't require persistent state: // Basic query const result = query("SELECT version()", "CSV"); -console.log(result); // "23.10.1.1" +console.log(result); // Version of the loaded native engine // Query with different output formats const jsonResult = query("SELECT 1 as id, 'Hello' as message", "JSON"); @@ -585,48 +587,45 @@ For complex operations that require maintaining state across queries: // Create a session with persistent storage const sess = new Session('./chdb-bun-tmp'); -try { - // Create a database and table - sess.query(` +// Create a database and table +sess.query(` CREATE DATABASE IF NOT EXISTS mydb; CREATE TABLE IF NOT EXISTS mydb.users ( id UInt32, name String, email String ) ENGINE = MergeTree() ORDER BY id - `, "CSV"); +`, "CSV"); - // Insert data - sess.query(` +// Insert data +sess.query(` INSERT INTO mydb.users VALUES (1, 'Alice', 'alice@example.com'), (2, 'Bob', 'bob@example.com'), (3, 'Charlie', 'charlie@example.com') - `, "CSV"); +`, "CSV"); - // Query the data - const users = sess.query("SELECT * FROM mydb.users ORDER BY id", "JSON"); - console.log("Users:", users); +// Query the data +const users = sess.query("SELECT * FROM mydb.users ORDER BY id", "JSON"); +console.log("Users:", users); - // Create and use custom functions - sess.query("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'Hello chDB'", "CSV"); - const greeting = sess.query("SELECT hello() as message", "Pretty"); - console.log(greeting); +// Create and use custom functions +sess.query("CREATE FUNCTION IF NOT EXISTS hello AS () -> 'Hello chDB'", "CSV"); +const greeting = sess.query("SELECT hello() as message", "Pretty"); +console.log(greeting); - // Aggregate queries - const stats = sess.query(` +// Aggregate queries +const stats = sess.query(` SELECT COUNT(*) as total_users, MAX(id) as max_id, MIN(id) as min_id FROM mydb.users - `, "JSON"); - console.log("Statistics:", stats); +`, "JSON"); +console.log("Statistics:", stats); -} finally { - // Always cleanup the session to free resources - sess.cleanup(); // This deletes the database files -} +// Keep the persistent database path. sess.cleanup() recursively deletes it; +// use cleanup() only when you intentionally want to discard this data. ``` --- @@ -964,17 +963,13 @@ cleanup: How to install and use chDB with Go -chDB-go provides Go bindings for chDB, enabling you to run ClickHouse queries directly in your Go applications with zero external dependencies. +chDB-go runs ClickHouse queries in-process from Go without a separate database server. It still requires a compatible native chDB library, either installed separately or supplied by a supported embedded-library module. ## Installation -First, install the chDB library: - -```bash -curl -sL https://lib.chdb.io | bash -``` +The published stable Go `v2.4.0` module is versioned separately from the native library. Install a compatible release from [chdb-core](https://github.com/chdb-io/chdb-core/releases), or opt into the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded) on a supported platform. The `https://lib.chdb.io` convenience installer fetches a moving latest version and does not pin it to this guide's Go module; verify the selected native version, especially before using Durable V1 or Arrow. @@ -982,31 +977,42 @@ curl -sL https://lib.chdb.io | bash Install the Go package: ```bash -go install github.com/chdb-io/chdb-go@latest +go install github.com/chdb-io/chdb-go/v2@v2.4.0 ``` Or add it to your `go.mod`: ```bash -go get github.com/chdb-io/chdb-go +go get github.com/chdb-io/chdb-go/v2@v2.4.0 ``` +### Optional Arrow and native parameter APIs +As of November 30, 2026, typed Arrow input/output is a separately published release candidate, not part of the stable root module's default API: + +```bash +go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 +``` + +This selects root bindings `v2.5.0-rc.2` and requires Go 1.23+, cgo, and a native engine with the Arrow C ABI (`26.11.0-rc.3` or newer; stable `26.11.1` is available). The optional module supports batch/reader input, typed tables and incremental batches, and bulk insert. It exchanges C Data/C Stream rather than IPC; input is copied into native-owned memory. The ordinary root module remains Go 1.21 and cgo-free. See the [Arrow module guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for installation, APIs and resource lifetimes. + +Stable `v2.4.0` uses client-side interpolation for positional `database/sql` arguments. The root `v2.5.0-rc.2` adds native named parameters (`{name:Type}`, including `sql.Named`); neither form adds transactions or prepared statements. An embedded engine import does not by itself guarantee the newer Arrow/parameter ABI. Static engine distribution is also a [separate experimental module](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md), not the default embedded-library path. + ## Usage ### Command line interface -chDB-go includes a CLI for quick queries: +chDB-go includes a CLI for quick queries. After `go install`, use `chdb-go` if Go's binary directory is on `PATH`; `./chdb-go` only applies when you built the executable in the current directory. ```bash # Simple query -./chdb-go "SELECT 123" +chdb-go "SELECT 123" # Interactive mode -./chdb-go +chdb-go # Interactive mode with persistent storage -./chdb-go --path /tmp/chdb +chdb-go --path /tmp/chdb ``` ### Go Library - quick start @@ -1018,7 +1024,7 @@ package main import ( "fmt" - "github.com/chdb-io/chdb-go/chdb" + "github.com/chdb-io/chdb-go/v2/chdb" ) func main() { @@ -1027,6 +1033,7 @@ func main() { if err != nil { panic(err) } + defer result.Free() fmt.Println(result) } ``` @@ -1039,7 +1046,7 @@ package main import ( "fmt" - "github.com/chdb-io/chdb-go/chdb" + "github.com/chdb-io/chdb-go/v2/chdb" ) func main() { @@ -1048,37 +1055,48 @@ func main() { if err != nil { panic(err) } - defer session.Cleanup() + defer session.Close() // Preserve /tmp/chdb-data; Cleanup() deletes the data path. // Create database and table - _, err = session.Query(` - CREATE DATABASE IF NOT EXISTS testdb; + created, err := session.Query("CREATE DATABASE IF NOT EXISTS testdb") + if err != nil { + panic(err) + } + if created != nil { + created.Free() + } + + table, err := session.Query(` CREATE TABLE IF NOT EXISTS testdb.test_table ( id UInt32, name String ) ENGINE = MergeTree() ORDER BY id - `, "") - + `) if err != nil { panic(err) } + if table != nil { + table.Free() + } // Insert data - _, err = session.Query(` + inserted, err := session.Query(` INSERT INTO testdb.test_table VALUES (1, 'Alice'), (2, 'Bob'), (3, 'Charlie') - `, "") - + `) if err != nil { panic(err) } + if inserted != nil { + inserted.Free() + } // Query data result, err := session.Query("SELECT * FROM testdb.test_table ORDER BY id", "Pretty") if err != nil { panic(err) } - + defer result.Free() fmt.Println(result) } ``` @@ -1092,7 +1110,7 @@ package main import ( "database/sql" "fmt" - _ "github.com/chdb-io/chdb-go/chdb/driver" + _ "github.com/chdb-io/chdb-go/v2/chdb/driver" ) func main() { @@ -1118,6 +1136,9 @@ func main() { } fmt.Printf("Count: %d\n", count) } + if err := rows.Err(); err != nil { + panic(err) + } } ``` @@ -1130,7 +1151,7 @@ package main import ( "fmt" "log" - "github.com/chdb-io/chdb-go/chdb" + "github.com/chdb-io/chdb-go/v2/chdb" ) func main() { @@ -1139,10 +1160,10 @@ func main() { if err != nil { log.Fatal(err) } - defer session.Cleanup() + defer session.Close() // Preserve /tmp/chdb-stream; Cleanup() deletes the data path. // Execute a streaming query for large dataset - streamResult, err := session.QueryStreaming( + streamResult, err := session.QueryStream( "SELECT number, number * 2 as double FROM system.numbers LIMIT 1000000", "CSV", ) @@ -1190,8 +1211,8 @@ func main() { ## API documentation chDB-go provides both high-level and low-level APIs: -- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/chdb.md)** - Recommended for most use cases -- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/lowApi.md)** - For advanced use cases requiring fine-grained control +- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/chdb.md)** - Recommended for most use cases +- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/lowApi.md)** - For advanced use cases requiring fine-grained control ## System requirements - Go 1.21 or later @@ -1224,7 +1245,9 @@ Instructions for how to get setup with chDB are available below for the followin How to install and use chDB with Node.js -chDB-node provides Node.js bindings for chDB, enabling you to run ClickHouse queries directly in your Node.js applications with zero external dependencies. +chDB-node runs ClickHouse queries in-process from Node.js without a separate database server. The npm package uses native, platform-specific libraries; check its supported platforms before installing. + +As of November 30, 2026, npm publishes `chdb@3.6.0` with native core `26.11.1` packages for Linux glibc and macOS, on x64/arm64; Node.js 18+ is required. In addition to the synchronous examples below, it provides asynchronous queries, native named parameters, formatted result streams and direct Arrow APIs. With the optional `apache-arrow` peer, applications can register tables/batches/readers, read typed tables or incremental batches, and bulk-insert Arrow data through C Data/C Stream. The existing `format: 'arrow'` / `toArrow()` route still uses IPC, and direct Arrow can still copy buffers. See the [3.6.0 Arrow guide](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md) for types, cancellation and cleanup rules. The `chdb/connection` ClickHouse-client adapter and Durable APIs remain experimental. ## Installation ```bash @@ -1302,8 +1325,8 @@ try { console.log("User Statistics:", stats); } finally { - // Always cleanup the session - session.cleanup(); // This deletes the database files + // Close the native connection. A caller-supplied database path is preserved. + session.cleanup(); } ``` @@ -2050,18 +2073,23 @@ sess.close() **URL:** https://clickhouse.com/docs/chdb/install/rust -How to install and use chDB Rust bindingsd +How to install and use chDB Rust bindings -chDB-rust provides experimental FFI (Foreign Function Interface) bindings for chDB, enabling you to run ClickHouse queries directly in your Rust applications with zero external dependencies. +chDB-rust provides FFI (Foreign Function Interface) bindings for in-process ClickHouse queries without a separate database server. The crate has Rust dependencies and needs a compatible native chDB library at link or runtime. ## Installation -### Install libchdb -Install the chDB library: +### Add the crate +Add the published `2.2.1` crate to your application's `Cargo.toml` (checked November 30, 2026). The binding still labels its API experimental: -```bash -curl -sL https://lib.chdb.io | bash +```toml +[dependencies] +chdb-rust = "=2.2.1" ``` +On supported Linux/macOS x86_64 and aarch64 targets, the build uses a compatible locally installed `libchdb` and header, or downloads its pinned stable engine version (`v26.11.1`). Generating FFI bindings also requires the Clang/libclang toolchain. To select a local library explicitly, set `CHDB_LIB_DIR` and `CHDB_INCLUDE_DIR`. A system installer that fetches the newest native engine is not necessarily pinned to the version used by this crate. For a dynamically linked binary distributed outside `cargo run`, configure its runtime library path or ship `libchdb` beside it with an appropriate rpath; alternatively, opt into the `static` feature. + +The default `arrow` feature uses Arrow 59 and provides direct C Data/C Stream results, incremental `RecordBatch` output, scoped reader registration, and batch/reader insertion. Existing Arrow IPC output is a separate path; direct Arrow does not guarantee zero-copy conversion. See the [Rust Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md) for supported types and ownership. Native named query parameters also work across buffered queries, result streams, Arrow streams and inserts. Durable V1 and its S3 backend remain opt-in through the `durable` and `durable-s3` features. + ## Usage chDB Rust provides both stateless and stateful query execution modes. @@ -2079,7 +2107,7 @@ fn main() -> Result<(), Box> { )?; println!("ClickHouse version: {}", result.data_utf8()?); - // Query with CSV file + // Query a CSV file if data.csv exists in the working directory let result = execute( "SELECT * FROM file('data.csv', 'CSV')", Some(&[Arg::OutputFormat(OutputFormat::JSONEachRow)]) @@ -2091,7 +2119,7 @@ fn main() -> Result<(), Box> { ``` ### Stateful usage (Sessions) -For queries requiring persistent state like databases and tables: +For queries that maintain state across calls, the example below uses a temporary directory. Add `tempdir = "0.3.7"` to your application's dependencies. The opt-in `with_auto_cleanup(true)` deletes that directory after the final handle closes; use a caller-owned path without auto-cleanup if the data must survive the process. ```rust use chdb_rust::{ @@ -2110,29 +2138,25 @@ fn main() -> Result<(), Box> { let session = SessionBuilder::new() .with_data_path(tmp.path()) .with_arg(Arg::LogLevel(LogLevel::Debug)) - .with_auto_cleanup(true) // Cleanup on drop + .with_auto_cleanup(true) // Delete this temporary data directory on drop .build()?; // Create database and table + session.execute("CREATE DATABASE demo", None)?; session.execute( - "CREATE DATABASE demo; USE demo", - Some(&[Arg::MultiQuery]) - )?; - - session.execute( - "CREATE TABLE logs (id UInt64, msg String) ENGINE = MergeTree() ORDER BY id", + "CREATE TABLE demo.logs (id UInt64, msg String) ENGINE = MergeTree() ORDER BY id", None, )?; // Insert data session.execute( - "INSERT INTO logs (id, msg) VALUES (1, 'Hello'), (2, 'World')", + "INSERT INTO demo.logs (id, msg) VALUES (1, 'Hello'), (2, 'World')", None, )?; // Query data let result = session.execute( - "SELECT * FROM logs ORDER BY id", + "SELECT * FROM demo.logs ORDER BY id", Some(&[Arg::OutputFormat(OutputFormat::JSONEachRow)]), )?; @@ -2158,11 +2182,8 @@ cargo build cargo test ``` -### Development dependencies -The project includes these development dependencies: -- `bindgen` (v0.70.1) - Generate FFI bindings from C headers -- `tempdir` (v0.3.7) - Temporary directory handling in tests -- `thiserror` (v1) - Error handling utilities +### Dependency categories +The crate uses `bindgen` to generate FFI bindings during its build and `thiserror` as a regular dependency. `tempdir` is only a development dependency of the crate, so applications using the temporary-session example above must add it explicitly. ## Error handling chDB Rust provides comprehensive error handling through the `Error` enum: @@ -2170,9 +2191,10 @@ chDB Rust provides comprehensive error handling through the `Error` enum: ```rust use chdb_rust::{execute, error::Error}; -match execute("SELECT 1", None) { +fn main() { + match execute("SELECT 1", None) { Ok(result) => { - println!("Success: {}", result.data_utf8()?); + println!("Success: {}", result.data_utf8_lossy()); }, Err(Error::QueryError(msg)) => { eprintln!("Query failed: {}", msg); @@ -2186,6 +2208,7 @@ match execute("SELECT 1", None) { Err(e) => { eprintln!("Other error: {}", e); } + } } ``` @@ -13132,11 +13155,12 @@ An Arrow `Table` holds batches of columnar data; a `RecordBatchReader` supplies | --- | --- | | Query an in-memory `pyarrow.Table` or one-shot `RecordBatchReader` | This guide's [`Python(arrow_table)` example](#querying-apache-arrow); [core reader behavior tests](https://github.com/chdb-io/chdb-core/blob/main/tests/test_arrow_c_stream_protocol.py) for one-shot streams | | Install chDB and use the existing `ArrowTable` or streaming result formats | [Python installation and examples](https://clickhouse.com/docs/chdb/install/python); [Python API reference](https://clickhouse.com/docs/chdb/api/python) | +| Use direct typed results, incremental batches, scoped registration or bulk insert without IPC | [Python 4.5.1 direct Arrow guide](https://github.com/chdb-io/chdb/blob/v4.5.1/docs/python-arrow-direct.md): `query_arrow`, `query_arrow_batches`, and `chdb.arrow.connect()`; requires core 26.11.1+ | | Use Arrow with the pandas-like DataStore layer | [DataStore I/O](https://clickhouse.com/docs/chdb/datastore/io) and [class reference](https://clickhouse.com/docs/chdb/datastore/class-reference) — a separate API from `Python(tbl)` | | Use Arrow Database Connectivity (ADBC), the standard database-driver API for Arrow results or bulk ingest | [ADBC installation and usage](https://clickhouse.com/docs/chdb/install/adbc); ordinary ADBC `BindStream` passes query parameters, not a temporary SQL table like `Python(tbl)` | | Work on the native Arrow contract or C examples | [Binding contract](https://github.com/chdb-io/chdb-core/blob/main/docs/NATIVE_ARROW_BINDING_CONTRACT.md), [input example](https://github.com/chdb-io/chdb-core/blob/main/examples/chdbArrowTest.c), [query-output example](https://github.com/chdb-io/chdb-core/blob/main/examples/chdbArrowQueryTest.c) | -This is the Python binding's Arrow documentation entry point. `ArrowTable`/`Arrow` result formats serialize Arrow data using its Inter-Process Communication (IPC) format; the pandas-like DataStore Arrow interface is another API. Consult their linked guides rather than assuming identical streaming or ownership behavior. +This is the Python binding's Arrow documentation entry point. `ArrowTable`/`Arrow` result formats serialize Arrow data using its Inter-Process Communication (IPC) format. Python 4.5.1 also exposes direct C Data results through `query_arrow` and `query_arrow_batches`; conversion may still copy data, and partial batch streams must be closed. The pandas-like DataStore Arrow interface and ADBC driver are separate APIs. Consult their linked guides rather than assuming identical streaming or ownership behavior. ## Setup Let's first create a virtual environment: diff --git a/llms.txt b/llms.txt index 76f90f56afc..5c76ed33edd 100644 --- a/llms.txt +++ b/llms.txt @@ -20,7 +20,11 @@ Things to remember when using chDB: - [Go](https://clickhouse.com/docs/chdb/install/go) - [Rust](https://clickhouse.com/docs/chdb/install/rust) - [C and C++](https://clickhouse.com/docs/chdb/install/c) -- [WebAssembly — chDB in the browser](https://wasm.chdb.io/) +- [Experimental WebAssembly — chDB in the browser](https://wasm.chdb.io/) (demo currently pins `chdb-wasm@0.3.0`; npm also publishes `0.4.0`) + +The [capability and release matrix](https://github.com/chdb-io/chdb#language-binding-capability-matrix), audited November 30, 2026, distinguishes published packages, RCs and source-only work. Published versions checked: Python 4.5.1, native core 26.11.1, Node.js 3.6.0, Go v2.4.0 and Rust 2.2.1. Python, Node and Rust now have direct typed Arrow APIs alongside IPC output; direct C Data/C Stream does not guarantee zero-copy. + +[Java/JDBC 1.1.0](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/) is published on Maven Central; its optional Arrow module remains experimental. Go typed Arrow requires the separate `github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1` module, root bindings v2.5.0-rc.2, Go 1.23+, cgo and a compatible engine; native named parameters are also a root-RC capability, not stable v2.4.0 driver behavior. [Ruby 0.2.0](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) includes chunked streaming. Bun 2.0.0 and [Zig 0.0.10](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10) are source releases; npm chdb-bun still serves 1.0.4. [.NET 0.0.3.69](https://www.nuget.org/packages/chdb/0.0.3.69) predates the newer main-branch session/runtime-package implementation. Do not present these as feature-equivalent clients or infer unpublished features from a repository README. ## Documentation From a908c145443f0217cf76f67b28c1722804fe9973 Mon Sep 17 00:00:00 2001 From: Shawn Chen Date: Mon, 30 Nov 2026 19:44:23 +1300 Subject: [PATCH 2/3] Simplify binding docs and document stable-core static builds --- README-zh.md | 2 +- README.md | 26 ++++++------ docs/index.mdx | 4 +- docs/install/bun.mdx | 19 +++------ docs/install/go.mdx | 58 +++++++++++++++++++-------- docs/install/nodejs.mdx | 4 +- docs/install/rust.mdx | 6 +-- llms-full.txt | 88 ++++++++++++++++++++++++----------------- llms.txt | 4 +- 9 files changed, 118 insertions(+), 93 deletions(-) diff --git a/README-zh.md b/README-zh.md index 59da57c2399..57ba23a8492 100644 --- a/README-zh.md +++ b/README-zh.md @@ -34,7 +34,7 @@ ## 安装方式 -Python 版 `chdb` 包支持 macOS 和 Linux(x86_64 和 ARM64)上的 Python 3.9+;各语言绑定的已发布版本、Arrow 输入/输出、流式查询、参数绑定和平台限制见[跨语言能力矩阵](README.md#language-binding-capability-matrix)(核查日期:2026-11-30)。矩阵区分稳定包、RC 和仅源码可用的功能;Java/JDBC 1.1.0 已发布至 Maven Central,可选 Arrow 模块仍为实验性;Go 的类型化 Arrow API 需要独立 RC 模块。浏览器中可试用实验性的 [WebAssembly 版本](https://wasm.chdb.io/),它不等同于原生包的全部能力。 +Python 包支持 macOS、Linux(x86_64 / ARM64)上的 Python 3.9+。其他绑定的版本、发布状态和功能见[跨语言能力矩阵](README.md#language-binding-capability-matrix);浏览器可试用实验性的 [WebAssembly 版本](https://wasm.chdb.io/)。 ```bash pip install chdb ``` diff --git a/README.md b/README.md index cdc4eb319a0..1bafea019fa 100644 --- a/README.md +++ b/README.md @@ -626,39 +626,35 @@ Please refer to [VERSION-GUIDE.md](VERSION-GUIDE.md) for more details. ## Language Binding Capability Matrix -The table below distinguishes published artifacts, release candidates (RCs), and source-only work. Package versions were checked against their registries, and APIs against release-tagged source; explicitly marked `main` entries describe unreleased code. This is not a claim of feature parity or a fresh end-to-end test of every package. “Source API” means implementation exists but its published-package behavior was not verified. - -**Audit date:** 2026-11-30. The native engine column uses the latest stable release, `26.11.1`, not the newer `26.11.2-rc.2` prerelease. Binding and engine versions are independent. +Checked 2026-11-30 against package registries and tagged source. RC, source-only and unreleased `main` features are marked; runtime suites were not rerun. Binding and engine versions are independent. Use stable core `26.11.1` for native installs unless a package requires its bundled engine. | Capability / dimension | Python
`chdb 4.5.1` | C / C++
`core 26.11.1` | Node.js
`chdb 3.6.0` | Go
`v2.4.0` + Arrow RC | Rust
`2.2.1` | Java
`1.1.0` | Ruby
`0.2.0` | .NET
`0.0.3.69` + main | Bun
`2.0.0 source` | Zig
`0.0.10 source` | WASM
`0.4.0` | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | Release status | [PyPI](https://pypi.org/project/chdb/4.5.1/) | [native release](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) | [npm](https://www.npmjs.com/package/chdb/v/3.6.0) | [stable module](https://proxy.golang.org/github.com/chdb-io/chdb-go/v2/@v/v2.4.0.info); separate [Arrow RC](https://proxy.golang.org/github.com/chdb-io/chdb-go/v2/arrow/@v/v0.1.0-rc.1.info) | [crates.io](https://crates.io/crates/chdb-rust/2.2.1); experimental API | [Maven Central GA](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/); Arrow module experimental | [RubyGems](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) | [NuGet](https://www.nuget.org/packages/chdb/0.0.3.69); newer main is not that package | [GitHub v2.0.0](https://github.com/chdb-io/chdb-bun/releases/tag/v2.0.0); npm still 1.0.4 | [source tag](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10); runtime not revalidated here | [npm](https://www.npmjs.com/package/chdb-wasm/v/0.4.0), experimental | -| Install / distribution | `pip` | Native release assets | npm platform packages; core 26.11.1 bundled | `go get` + installed or opt-in embedded engine; Arrow separate | Cargo; auto-downloads core 26.11.1, or custom dynamic/static library | Central driver + platform native JAR; optional `chdb-arrow` | Native extension compiled and engine downloaded at install | Published package needs native lib; main adds platform runtime packages | Source build + Clang; core 26.11.0-rc.2 | Zig 0.15.2+; Linux x86_64/aarch64 build targets | npm WebAssembly; browser or Node 23+ Worker | +| Install / distribution | `pip` | Shared / static release assets | npm platform packages | Dynamic / embedded; [static RC](docs/install/go.mdx) | Cargo; dynamic or `static` feature | Central driver + native JAR; optional `chdb-arrow` | Native extension + downloaded engine | NuGet + native lib; main adds runtime packages | Source + Clang; [build with core 26.11.1](docs/install/bun.mdx) | Zig 0.15.2+; Linux x86_64/aarch64 | npm; browser or Node 23+ Worker | | Session / persistent path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Multi-connection same path | Single database instance | Published path wrapper; main retains per-session connections | Source: one shared native connection, reused per active path | Source connection / path API | Worker-local paths; no verified reload persistence | | Durable V1 | Supported | ABI primitives | Experimental adapter + native engine | Adapter requires compatible native ABI | Opt-in `durable` / `durable-s3` features | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported | -| Arrow IPC output bytes | Supported | Supported | Supported; distinct from direct Arrow | Supported in root module | Supported; distinct from direct Arrow | No dedicated IPC API; direct Arrow module instead | Supported | Source API; published package unverified | No binary-safe API | No selectable Arrow format (fixed JSONEachRow) | Arrow IPC format not verified here | +| Arrow IPC output bytes | Supported | Supported | Supported | Supported in root module | Supported | Not exposed | Supported | Source API; published package unverified | No binary-safe API | No selectable Arrow format (fixed JSONEachRow) | Arrow IPC format not verified here | | Typed Arrow API | `Table` / `RecordBatch` | C structs, no language type | `apache-arrow` Table / RecordBatch | Optional Arrow RC: Table / RecordBatch | Arrow 59 `RecordBatch` | Optional module: `VectorSchemaRoot` / `ArrowReader` | Not supported | Not supported | Not supported | Not supported | Not supported | -| Direct Arrow C Data / Stream (no IPC) | Supported with core 26.11.1+ | Supported | Supported; input/output conversions copy | Optional Arrow RC; input copied to native memory | Supported; conversions may copy | Optional experimental module; conversions may copy | Not supported | Not supported | Not supported | Not supported | Native C Data API not exposed | +| Direct Arrow C Data / Stream (no IPC) | Supported | Supported | Supported | Optional Arrow RC | Supported | Optional experimental module | Not supported | Not supported | Not supported | Not supported | Native C Data API not exposed | | Arrow input / registration | `Python(...)`, scoped registration and insert | C Data / Stream registration and insert | Table / batch / async reader registration and insert | Optional Arrow RC: batch / reader scan and insert | Scoped reader registration and direct batch / reader insert | Optional module: batch / owned-reader registration and insert | Not supported | Not supported | Not supported | Not supported | Not supported | | Streaming result | Formatted chunks and direct Arrow batches | Formatted chunks and Arrow batches | Async chunks and direct Arrow batches; one active stream/session | Formatted chunks; typed batches via Arrow RC | Formatted chunks, Arrow batches; streaming insert | Forward-only JDBC `ResultSet`; Arrow batch reader | Chunked query / fetch / cancel API | Not supported | Not supported | Chunked fetch / cancel API (source) | Async worker result chunks | | Parameter binding | Named engine parameters | Named ABI | Native named parameters, including direct Arrow queries | Stable: driver interpolation; root RC adds native named parameters | Native named parameters across query / stream / insert | JDBC `PreparedStatement`; named parameters on streaming Arrow queries | Client SQL interpolation | Not supported | Not supported | Not supported | Not supported | | Driver / ecosystem API | DBAPI / ADBC | C ABI | Experimental `@clickhouse/client` adapter | `database/sql` (no transactions/prepared statements) | No standard database driver in this crate | JDBC; Arrow module is not Java ADBC | SQLite-style API | No ADO.NET provider | None | None | None | -**Session boundary:** chdb-core allows only one active data path per process. "Multi-connection same path" means a binding can open multiple connections on the same data path; concurrent different data paths are uniformly unsupported and require closing before switching. - -**Arrow implementation differences:** Python 4.5.1 and Node 3.6.0 now expose direct typed Arrow results alongside their existing IPC output. Rust 2.2.1 supports direct result batches, scoped reader input and bulk insert. Go's separately published Arrow RC and Java's optional `chdb-arrow` module also provide C Data/C Stream input, typed output and insert. These are distinct from Go's Parquet-based `database/sql` rows and Java's `RowBinaryWithNamesAndTypes` JDBC `ResultSet`. **Avoiding IPC is not an end-to-end zero-copy guarantee:** conversion, ownership transfer and language-specific buffer copies still apply. Supported types and one-shot reader lifetimes differ; consult the binding guides linked below. +Native connections can share one data path per process. Close all connections before switching paths. -**Feature flags and engine ABI:** Rust enables `arrow` by default; Durable V1 and S3 storage require opt-in `durable` and `durable-s3` features. Go's stable root module remains Go 1.21 and cgo-free. Its Arrow module `github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1` requires Go 1.23+, cgo, root bindings `v2.5.0-rc.2`, and a native Arrow ABI from core `26.11.0-rc.3` or newer. The same root RC adds native named parameters, including `sql.Named`; stable v2.4.0's positional driver arguments are interpolated. The installed engine, embedded engine module, Arrow module, and experimental static engine module are separately selected/versioned; installing the root module alone does not enable them. Go Durable V1 also requires a compatible native ABI. +Direct Arrow avoids IPC serialization but may still copy buffers. Go's ordinary `database/sql` rows use Parquet; JDBC `ResultSet` uses `RowBinaryWithNamesAndTypes`. Typed Arrow is a separate API in both bindings. -**Java release boundary:** `com.clickhouse.chdb` 1.1.0 is available from Maven Central: the JDBC driver, optional Arrow module and four Linux/macOS x86_64/arm64 native packages have published POMs. The JDBC, Arrow and macOS arm64 native JARs were also checked for availability. Keep all artifacts on the same binding version; they bundle core 26.11.1. Some repository READMEs still describe the earlier RC/publication gate. Ordinary JDBC is now GA; the optional Arrow module remains experimental, requires Arrow's JVM access flag, and uses a separate connection rather than exporting an existing `ResultSet`. Neither JDBC transactions nor batch updates are supported. +Go's optional Arrow and static modules require root bindings `v2.5.0-rc.2`; the [Go guide](docs/install/go.mdx) covers their build requirements. Rust enables `arrow` by default; `durable` and `durable-s3` are opt-in. -**Source and cleanup caveats:** Bun 2.0.0 is a source release, not npm 1.0.4: its native wrapper now reuses a connection for the active path, but `cleanup()` still deletes the supplied directory. Go's `Cleanup()` also deletes the data path when the last session closes; use `Close()` to preserve caller-owned data. .NET's newer [main source](https://github.com/chdb-io/chdb-dotnet/tree/88d9e6948e7dd95b4e14de5175713d0db1eb81ab) retains per-session native connections and defines runtime packages, but NuGet still serves 0.0.3.69; do not attribute those changes to that published package. Zig 0.0.10 updates the native ABI and build to Zig 0.15.2 with Linux-only build targets; its source includes chunked streaming and typed JSON row decoding, not typed Arrow. Neither its native build nor every language's runtime suite was rerun for this documentation audit. +Keep Java's driver, Arrow module and native JAR on the same version. Arrow requires its JVM access flag and a separate connection; it cannot export an existing JDBC result. JDBC transactions and batch updates are unsupported. -**WASM boundary:** npm still publishes 0.4.0, while the separate browser shell pins 0.3.0. The published 0.4.0 API exposes Worker-based queries, explicit connections, byte results, chunked streams and file registration; it has no native parameter-binding or typed Arrow interface. A path inside its in-memory filesystem is not verified persistence across page reloads, and neither the shell nor the package implies parity with the native engine. +Bun `cleanup()` deletes its data directory. Go's `Cleanup()` does so when the last session closes; use `Close()` to preserve data. The .NET main-only capabilities refer to [this source snapshot](https://github.com/chdb-io/chdb-dotnet/tree/88d9e6948e7dd95b4e14de5175713d0db1eb81ab). Zig's typed row decoding is JSON-based, not Arrow. -**API evidence and usage guides:** [Python 4.5.1 direct Arrow](https://github.com/chdb-io/chdb/blob/v4.5.1/docs/python-arrow-direct.md), [Node 3.6.0 Arrow APIs](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md), [Go Arrow RC](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md), [Go RC native parameter implementation](https://github.com/chdb-io/chdb-go/blob/v2.5.0-rc.2/chdb/driver/driver.go), [Rust 2.2.1 Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md), [Java 1.1.0 installation](https://github.com/chdb-io/chdb-java/blob/v1.1.0/docs/releases/1.1.0.md) and [Arrow module](https://github.com/chdb-io/chdb-java/blob/v1.1.0/chdb-arrow/README.md), [Ruby 0.2.0 streaming implementation](https://github.com/chdb-io/chdb-ruby/blob/v0.2.0/ext/chdb/connection.c), [Bun 2.0.0 connection implementation](https://github.com/chdb-io/chdb-bun/blob/v2.0.0/lib/chdb_bun.c), [Zig 0.0.10 implementation](https://github.com/chdb-io/chdb-zig/blob/0.0.10/src/chdb.zig), and [published WASM 0.4.0 API](https://unpkg.com/chdb-wasm@0.4.0/dist/async.d.ts). +The browser shell pins WASM 0.3.0 while npm publishes 0.4.0. Worker-local paths do not establish persistence across page reloads. -**Notable feature note:** Python DataStore is a pandas-like lazy execution data layer; Node L3 Kysely-style primitives target typed SQL builder use cases; Go's SQL driver API means it integrates with the standard Go `database/sql` package; Rust's Arrow C Data API means Arrow is a first-class data path, not just an output bytes format. +API guides and source: [Python Arrow](https://github.com/chdb-io/chdb/blob/v4.5.1/docs/python-arrow-direct.md), [Node Arrow](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md), [Go Arrow RC](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md), [Go named parameters](https://github.com/chdb-io/chdb-go/blob/v2.5.0-rc.2/chdb/driver/driver.go), [Rust Arrow](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md), [Java installation](https://github.com/chdb-io/chdb-java/blob/v1.1.0/docs/releases/1.1.0.md) and [Arrow module](https://github.com/chdb-io/chdb-java/blob/v1.1.0/chdb-arrow/README.md), [Ruby streaming](https://github.com/chdb-io/chdb-ruby/blob/v0.2.0/ext/chdb/connection.c), [Bun connections](https://github.com/chdb-io/chdb-bun/blob/v2.0.0/lib/chdb_bun.c), [Zig](https://github.com/chdb-io/chdb-zig/blob/0.0.10/src/chdb.zig), and [WASM API](https://unpkg.com/chdb-wasm@0.4.0/dist/async.d.ts). ## License Apache 2.0, see [LICENSE](LICENSE.txt) for more information. diff --git a/docs/index.mdx b/docs/index.mdx index b124736a388..6e07720200b 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -73,9 +73,7 @@ chDB has the following language bindings: * [Bun](/chdb/install/bun) * [C and C++](/chdb/install/c) -As of November 30, 2026, the checked published versions are Python `4.5.1`, Node.js `3.6.0`, Go `v2.4.0`, Rust `2.2.1`, and native core `26.11.1`. [Java/JDBC `1.1.0`](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/) is now available from Maven Central with platform-native JARs; its optional `chdb-arrow` module remains experimental. Go's typed Arrow APIs are in the independently published `v0.1.0-rc.1` Arrow module, which requires root bindings `v2.5.0-rc.2`, cgo and a compatible engine; they are not enabled by installing stable Go `v2.4.0` alone. - -[Ruby `0.2.0`](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) includes chunked streaming. [Bun `2.0.0`](https://github.com/chdb-io/chdb-bun/releases/tag/v2.0.0) and [Zig `0.0.10`](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10) have source releases; npm `chdb-bun` remains `1.0.4`, and Zig's current build targets are Linux x86_64/aarch64. [.NET's published `0.0.3.69`](https://www.nuget.org/packages/chdb/0.0.3.69) does not include its newer main-branch session/runtime-packaging work. These clients are not feature-equivalent. The [browser WebAssembly build](https://wasm.chdb.io/) remains experimental, and its shell pins `0.3.0` while npm publishes `0.4.0`. +Additional bindings include [Java/JDBC](https://github.com/chdb-io/chdb-java), [Ruby](https://github.com/chdb-io/chdb-ruby), [.NET](https://github.com/chdb-io/chdb-dotnet), [Zig](https://github.com/chdb-io/chdb-zig), and experimental [WebAssembly](https://wasm.chdb.io/). Check the [capability matrix](https://github.com/chdb-io/chdb#language-binding-capability-matrix) for published versions, source-only features and platform limits. The [Go guide](/chdb/install/go#static-linking) covers its experimental static build. ## How do I get started? {#how-do-i-get-started} diff --git a/docs/install/bun.mdx b/docs/install/bun.mdx index eaf36e37369..72d962ad826 100644 --- a/docs/install/bun.mdx +++ b/docs/install/bun.mdx @@ -7,43 +7,36 @@ keywords: ['chdb', 'bun', 'javascript', 'typescript', 'embedded', 'clickhouse', doc_type: 'guide' --- -chDB-bun provides experimental FFI (Foreign Function Interface) bindings for in-process ClickHouse queries from Bun. As of November 30, 2026, GitHub has a `v2.0.0` source release, while npm `chdb-bun` still serves `1.0.4`; these are not the same implementation. The source release uses native core `26.11.0-rc.2` and requires build tools. It does not expose binary-safe Arrow results, typed Arrow, streaming results or native parameter binding. +chDB-bun is an experimental FFI binding. This guide builds source release `v2.0.0` with stable core `v26.11.1`; npm still serves `1.0.4`. The binding has no binary-safe Arrow, result streaming or native parameter API. ## Installation {#installation} -First, install the required system dependencies: - -#### Install libchdb {#install-libchdb} - -The source build's `lib/update_libchdb.sh` downloads core `v26.11.0-rc.2` from [chdb-core releases](https://github.com/chdb-io/chdb-core/releases). A separately installed system library is not a substitute for checking which library the built FFI wrapper actually loads. - -#### Install build tools {#install-build-tools} - -The source build script invokes `clang`; install Clang on a supported macOS or Linux host. +Install Bun and Clang on macOS or Linux. The build below downloads [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1). -The GitHub `v2.0.0` release is a source build; a standalone `bun add github:...` does not install/build the native `.so` file used by its FFI entry point. Clone the audited tag and build it locally: +Clone the tag and update its downloader's engine pin before building: ```bash git clone --branch v2.0.0 --depth 1 https://github.com/chdb-io/chdb-bun.git cd chdb-bun +sed -i.bak 's/^LATEST_RELEASE=.*/LATEST_RELEASE=v26.11.1/' lib/update_libchdb.sh bun install bun run build ``` -Run the examples below from the built source directory; they import `./index.ts`. The separately published npm `chdb-bun` package currently has a different version (`1.0.4`) and is not the source version described here. +Run the examples from this directory. A `bun add github:...` alone does not build the native wrapper. ## Usage {#usage} -chDB-bun supports one-off queries and a path-based `Session` wrapper. In `v2.0.0`, the native wrapper keeps one shared connection open while the active path stays the same. Switching paths closes that connection and opens another; separate `Session` objects do not each own an independent native connection. `cleanup()` closes the matching connection and recursively deletes the supplied data directory. +The native wrapper reuses one connection for the active path. Switching paths replaces it; `Session` objects do not own independent connections. `cleanup()` closes it and deletes the data directory. ### Ephemeral queries {#ephemeral-queries} diff --git a/docs/install/go.mdx b/docs/install/go.mdx index 53558c337af..c6bd7bb2261 100644 --- a/docs/install/go.mdx +++ b/docs/install/go.mdx @@ -7,44 +7,70 @@ keywords: ['chdb', 'go', 'golang', 'embedded', 'clickhouse', 'sql', 'olap'] doc_type: 'guide' --- -chDB-go runs ClickHouse queries in-process from Go without a separate database server. It still requires a compatible native chDB library, either installed separately or supplied by a supported embedded-library module. +chDB-go runs ClickHouse queries in-process. The default binding loads a shared native library without cgo; static linking is opt-in. ## Installation {#installation} - - +Install the stable module (Go 1.21+): -The published stable Go `v2.4.0` module is versioned separately from the native library. Install a compatible release from [chdb-core](https://github.com/chdb-io/chdb-core/releases), or opt into the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded) on a supported platform. The `https://lib.chdb.io` convenience installer fetches a moving latest version and does not pin it to this guide's Go module; verify the selected native version, especially before using Durable V1 or Arrow. +```bash +go get github.com/chdb-io/chdb-go/v2@v2.4.0 +``` - - +Install [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) for your platform and set `CHDB_LIB_PATH` to the absolute path of `libchdb.so`. Alternatively, import the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded); it extracts its packaged shared library at runtime and is not static linking. -Install the Go package: +For the optional CLI: ```bash go install github.com/chdb-io/chdb-go/v2@v2.4.0 ``` -Or add it to your `go.mod`: +### Optional Arrow and native parameter APIs {#optional-arrow} + +Typed Arrow input, batch results and bulk insert require a separate RC module, Go 1.23+, cgo and core `v26.11.1`: ```bash -go get github.com/chdb-io/chdb-go/v2@v2.4.0 +go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 ``` - - +This selects root bindings `v2.5.0-rc.2`, which also add native named parameters (`{name:Type}`, including `sql.Named`). Stable `v2.4.0` interpolates positional `database/sql` arguments. Neither version supports transactions or prepared statements. -### Optional Arrow and native parameter APIs {#optional-arrow} +Arrow uses C Data/C Stream with copies into native-owned input buffers. See the [Arrow guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for types and lifetimes. If an embedded engine is older, point `CHDB_LIB_PATH` at the stable library above. + +### Static linking (experimental) {#static-linking} -As of November 30, 2026, typed Arrow input/output is a separately published release candidate, not part of the stable root module's default API: +Static builds require cgo, a C toolchain and root bindings `v2.5.0-rc.2`. Linux and macOS on amd64/arm64 are supported. + +To use stable core `v26.11.1`, extract its platform-specific static release archive and use its matching `chdb.h` and `libchdb.a`. For macOS: ```bash -go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 +go get github.com/chdb-io/chdb-go/v2@v2.5.0-rc.2 +CHDB_STATIC_DIR=/absolute/path/to/extracted-core-26.11.1 +CGO_ENABLED=1 \ + CGO_CFLAGS="-DCHDB_STATIC_HEADER=\"$CHDB_STATIC_DIR/chdb.h\"" \ + CGO_LDFLAGS="-Wl,-force_load,$CHDB_STATIC_DIR/libchdb.a" \ + go build -tags chdb_static,chdb_static_manual -o myapp . ``` -This selects root bindings `v2.5.0-rc.2` and requires Go 1.23+, cgo, and a native engine with the Arrow C ABI (`26.11.0-rc.3` or newer; stable `26.11.1` is available). The optional module supports batch/reader input, typed tables and incremental batches, and bulk insert. It exchanges C Data/C Stream rather than IPC; input is copied into native-owned memory. The ordinary root module remains Go 1.21 and cgo-free. See the [Arrow module guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for installation, APIs and resource lifetimes. +For Linux linker flags, see [manual linking](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md#manual-linking-advanced). + +A separate prepackaged module avoids manual archive linking: + +```bash +go get go.chdb.io/chdb/static@v0.261102.0-rc.1.1 +``` + +Add this import to the application: + +```go +import _ "go.chdb.io/chdb/static" +``` + +```bash +CGO_ENABLED=1 go build -tags chdb_static -o myapp . +``` -Stable `v2.4.0` uses client-side interpolation for positional `database/sql` arguments. The root `v2.5.0-rc.2` adds native named parameters (`{name:Type}`, including `sql.Named`); neither form adds transactions or prepared statements. An embedded engine import does not by itself guarantee the newer Arrow/parameter ABI. Static engine distribution is also a [separate experimental module](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md), not the default embedded-library path. +This RC module pins core `v26.11.2-rc.1` and selects the matching root binding. `CHDB_LIB_PATH` cannot override a statically linked engine; use manual linking above for stable core. Do not combine the prepackaged import with `chdb_static_manual` or `lib/embedded`. ## Usage {#usage} diff --git a/docs/install/nodejs.mdx b/docs/install/nodejs.mdx index 24f7dc279da..db426df944a 100644 --- a/docs/install/nodejs.mdx +++ b/docs/install/nodejs.mdx @@ -7,9 +7,7 @@ keywords: ['chdb', 'nodejs', 'javascript', 'embedded', 'clickhouse', 'sql', 'ola doc_type: 'guide' --- -chDB-node runs ClickHouse queries in-process from Node.js without a separate database server. The npm package uses native, platform-specific libraries; check its supported platforms before installing. - -As of November 30, 2026, npm publishes `chdb@3.6.0` with native core `26.11.1` packages for Linux glibc and macOS, on x64/arm64; Node.js 18+ is required. In addition to the synchronous examples below, it provides asynchronous queries, native named parameters, formatted result streams and direct Arrow APIs. With the optional `apache-arrow` peer, applications can register tables/batches/readers, read typed tables or incremental batches, and bulk-insert Arrow data through C Data/C Stream. The existing `format: 'arrow'` / `toArrow()` route still uses IPC, and direct Arrow can still copy buffers. See the [3.6.0 Arrow guide](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md) for types, cancellation and cleanup rules. The `chdb/connection` ClickHouse-client adapter and Durable APIs remain experimental. +`chdb@3.6.0` embeds core `26.11.1` for Node.js 18+ on Linux glibc and macOS (x64/arm64). It supports sync/async queries, native named parameters and result streams. The optional `apache-arrow` peer enables typed input, batch results and bulk insert; see the [Arrow guide](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md) for ownership and type limits. Direct Arrow may copy buffers; `format: 'arrow'` / `toArrow()` uses IPC. The ClickHouse-client adapter and Durable APIs remain experimental. ## Installation {#installation} diff --git a/docs/install/rust.mdx b/docs/install/rust.mdx index 86c64f6e46a..0e61a7f6fde 100644 --- a/docs/install/rust.mdx +++ b/docs/install/rust.mdx @@ -13,16 +13,16 @@ chDB-rust provides FFI (Foreign Function Interface) bindings for in-process Clic ### Add the crate {#add-crate} -Add the published `2.2.1` crate to your application's `Cargo.toml` (checked November 30, 2026). The binding still labels its API experimental: +Add the experimental `2.2.1` crate to `Cargo.toml`: ```toml [dependencies] chdb-rust = "=2.2.1" ``` -On supported Linux/macOS x86_64 and aarch64 targets, the build uses a compatible locally installed `libchdb` and header, or downloads its pinned stable engine version (`v26.11.1`). Generating FFI bindings also requires the Clang/libclang toolchain. To select a local library explicitly, set `CHDB_LIB_DIR` and `CHDB_INCLUDE_DIR`. A system installer that fetches the newest native engine is not necessarily pinned to the version used by this crate. For a dynamically linked binary distributed outside `cargo run`, configure its runtime library path or ship `libchdb` beside it with an appropriate rpath; alternatively, opt into the `static` feature. +On Linux/macOS x86_64 and aarch64, the build uses a local `libchdb` and matching header or downloads stable core `v26.11.1`. Clang/libclang is required for FFI generation. Set `CHDB_LIB_DIR` and `CHDB_INCLUDE_DIR` to select a local engine. Distributed dynamic binaries need a runtime library path or rpath; enable the `static` feature to link the engine into the executable. -The default `arrow` feature uses Arrow 59 and provides direct C Data/C Stream results, incremental `RecordBatch` output, scoped reader registration, and batch/reader insertion. Existing Arrow IPC output is a separate path; direct Arrow does not guarantee zero-copy conversion. See the [Rust Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md) for supported types and ownership. Native named query parameters also work across buffered queries, result streams, Arrow streams and inserts. Durable V1 and its S3 backend remain opt-in through the `durable` and `durable-s3` features. +The default `arrow` feature uses Arrow 59 for direct batch results, reader registration and bulk insert. Direct Arrow may copy buffers; IPC output remains separate. See the [Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md) for types and ownership. Native named parameters work across queries, streams and inserts. `durable` and `durable-s3` are opt-in. ## Usage {#usage} diff --git a/llms-full.txt b/llms-full.txt index f661af72cd9..3975b163432 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -82,9 +82,7 @@ chDB has the following language bindings: * [Bun](https://clickhouse.com/docs/chdb/install/bun) * [C and C++](https://clickhouse.com/docs/chdb/install/c) -As of November 30, 2026, the checked published versions are Python `4.5.1`, Node.js `3.6.0`, Go `v2.4.0`, Rust `2.2.1`, and native core `26.11.1`. [Java/JDBC `1.1.0`](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/) is now available from Maven Central with platform-native JARs; its optional `chdb-arrow` module remains experimental. Go's typed Arrow APIs are in the independently published `v0.1.0-rc.1` Arrow module, which requires root bindings `v2.5.0-rc.2`, cgo and a compatible engine; they are not enabled by installing stable Go `v2.4.0` alone. - -[Ruby `0.2.0`](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) includes chunked streaming. [Bun `2.0.0`](https://github.com/chdb-io/chdb-bun/releases/tag/v2.0.0) and [Zig `0.0.10`](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10) have source releases; npm `chdb-bun` remains `1.0.4`, and Zig's current build targets are Linux x86_64/aarch64. [.NET's published `0.0.3.69`](https://www.nuget.org/packages/chdb/0.0.3.69) does not include its newer main-branch session/runtime-packaging work. These clients are not feature-equivalent. The [browser WebAssembly build](https://wasm.chdb.io/) remains experimental, and its shell pins `0.3.0` while npm publishes `0.4.0`. +Additional bindings include [Java/JDBC](https://github.com/chdb-io/chdb-java), [Ruby](https://github.com/chdb-io/chdb-ruby), [.NET](https://github.com/chdb-io/chdb-dotnet), [Zig](https://github.com/chdb-io/chdb-zig), and experimental [WebAssembly](https://wasm.chdb.io/). Check the [capability matrix](https://github.com/chdb-io/chdb#language-binding-capability-matrix) for published versions, source-only features and platform limits. The [Go guide](https://clickhouse.com/docs/chdb/install/go#static-linking) covers its experimental static build. ## How do I get started? * If you're using [Go](https://clickhouse.com/docs/chdb/install/go), [Rust](https://clickhouse.com/docs/chdb/install/rust), [NodeJS](https://clickhouse.com/docs/chdb/install/nodejs), [Bun](https://clickhouse.com/docs/chdb/install/bun) or [C and C++](https://clickhouse.com/docs/chdb/install/c), take a look at the corresponding language pages. @@ -523,39 +521,34 @@ To learn more about how to use it, see the following developer guides: How to install and use chDB with Bun runtime -chDB-bun provides experimental FFI (Foreign Function Interface) bindings for in-process ClickHouse queries from Bun. As of November 30, 2026, GitHub has a `v2.0.0` source release, while npm `chdb-bun` still serves `1.0.4`; these are not the same implementation. The source release uses native core `26.11.0-rc.2` and requires build tools. It does not expose binary-safe Arrow results, typed Arrow, streaming results or native parameter binding. +chDB-bun is an experimental FFI binding. This guide builds source release `v2.0.0` with stable core `v26.11.1`; npm still serves `1.0.4`. The binding has no binary-safe Arrow, result streaming or native parameter API. ## Installation -First, install the required system dependencies: - -#### Install libchdb -The source build's `lib/update_libchdb.sh` downloads core `v26.11.0-rc.2` from [chdb-core releases](https://github.com/chdb-io/chdb-core/releases). A separately installed system library is not a substitute for checking which library the built FFI wrapper actually loads. - -#### Install build tools -The source build script invokes `clang`; install Clang on a supported macOS or Linux host. +Install Bun and Clang on macOS or Linux. The build below downloads [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1). -The GitHub `v2.0.0` release is a source build; a standalone `bun add github:...` does not install/build the native `.so` file used by its FFI entry point. Clone the audited tag and build it locally: +Clone the tag and update its downloader's engine pin before building: ```bash git clone --branch v2.0.0 --depth 1 https://github.com/chdb-io/chdb-bun.git cd chdb-bun +sed -i.bak 's/^LATEST_RELEASE=.*/LATEST_RELEASE=v26.11.1/' lib/update_libchdb.sh bun install bun run build ``` -Run the examples below from the built source directory; they import `./index.ts`. The separately published npm `chdb-bun` package currently has a different version (`1.0.4`) and is not the source version described here. +Run the examples from this directory. A `bun add github:...` alone does not build the native wrapper. ## Usage -chDB-bun supports one-off queries and a path-based `Session` wrapper. In `v2.0.0`, the native wrapper keeps one shared connection open while the active path stays the same. Switching paths closes that connection and opens another; separate `Session` objects do not each own an independent native connection. `cleanup()` closes the matching connection and recursively deletes the supplied data directory. +The native wrapper reuses one connection for the active path. Switching paths replaces it; `Session` objects do not own independent connections. `cleanup()` closes it and deletes the data directory. ### Ephemeral queries For simple, one-off queries that don't require persistent state: @@ -963,42 +956,67 @@ cleanup: How to install and use chDB with Go -chDB-go runs ClickHouse queries in-process from Go without a separate database server. It still requires a compatible native chDB library, either installed separately or supplied by a supported embedded-library module. +chDB-go runs ClickHouse queries in-process. The default binding loads a shared native library without cgo; static linking is opt-in. ## Installation - - +Install the stable module (Go 1.21+): -The published stable Go `v2.4.0` module is versioned separately from the native library. Install a compatible release from [chdb-core](https://github.com/chdb-io/chdb-core/releases), or opt into the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded) on a supported platform. The `https://lib.chdb.io` convenience installer fetches a moving latest version and does not pin it to this guide's Go module; verify the selected native version, especially before using Durable V1 or Arrow. +```bash +go get github.com/chdb-io/chdb-go/v2@v2.4.0 +``` - - +Install [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) for your platform and set `CHDB_LIB_PATH` to the absolute path of `libchdb.so`. Alternatively, import the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded); it extracts its packaged shared library at runtime and is not static linking. -Install the Go package: +For the optional CLI: ```bash go install github.com/chdb-io/chdb-go/v2@v2.4.0 ``` -Or add it to your `go.mod`: +### Optional Arrow and native parameter APIs +Typed Arrow input, batch results and bulk insert require a separate RC module, Go 1.23+, cgo and core `v26.11.1`: ```bash -go get github.com/chdb-io/chdb-go/v2@v2.4.0 +go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 ``` - - +This selects root bindings `v2.5.0-rc.2`, which also add native named parameters (`{name:Type}`, including `sql.Named`). Stable `v2.4.0` interpolates positional `database/sql` arguments. Neither version supports transactions or prepared statements. -### Optional Arrow and native parameter APIs -As of November 30, 2026, typed Arrow input/output is a separately published release candidate, not part of the stable root module's default API: +Arrow uses C Data/C Stream with copies into native-owned input buffers. See the [Arrow guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for types and lifetimes. If an embedded engine is older, point `CHDB_LIB_PATH` at the stable library above. + +### Static linking (experimental) +Static builds require cgo, a C toolchain and root bindings `v2.5.0-rc.2`. Linux and macOS on amd64/arm64 are supported. + +To use stable core `v26.11.1`, extract its platform-specific static release archive and use its matching `chdb.h` and `libchdb.a`. For macOS: ```bash -go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 +go get github.com/chdb-io/chdb-go/v2@v2.5.0-rc.2 +CHDB_STATIC_DIR=/absolute/path/to/extracted-core-26.11.1 +CGO_ENABLED=1 \ + CGO_CFLAGS="-DCHDB_STATIC_HEADER=\"$CHDB_STATIC_DIR/chdb.h\"" \ + CGO_LDFLAGS="-Wl,-force_load,$CHDB_STATIC_DIR/libchdb.a" \ + go build -tags chdb_static,chdb_static_manual -o myapp . ``` -This selects root bindings `v2.5.0-rc.2` and requires Go 1.23+, cgo, and a native engine with the Arrow C ABI (`26.11.0-rc.3` or newer; stable `26.11.1` is available). The optional module supports batch/reader input, typed tables and incremental batches, and bulk insert. It exchanges C Data/C Stream rather than IPC; input is copied into native-owned memory. The ordinary root module remains Go 1.21 and cgo-free. See the [Arrow module guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for installation, APIs and resource lifetimes. +For Linux linker flags, see [manual linking](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md#manual-linking-advanced). + +A separate prepackaged module avoids manual archive linking: -Stable `v2.4.0` uses client-side interpolation for positional `database/sql` arguments. The root `v2.5.0-rc.2` adds native named parameters (`{name:Type}`, including `sql.Named`); neither form adds transactions or prepared statements. An embedded engine import does not by itself guarantee the newer Arrow/parameter ABI. Static engine distribution is also a [separate experimental module](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md), not the default embedded-library path. +```bash +go get go.chdb.io/chdb/static@v0.261102.0-rc.1.1 +``` + +Add this import to the application: + +```go +import _ "go.chdb.io/chdb/static" +``` + +```bash +CGO_ENABLED=1 go build -tags chdb_static -o myapp . +``` + +This RC module pins core `v26.11.2-rc.1` and selects the matching root binding. `CHDB_LIB_PATH` cannot override a statically linked engine; use manual linking above for stable core. Do not combine the prepackaged import with `chdb_static_manual` or `lib/embedded`. ## Usage ### Command line interface @@ -1245,9 +1263,7 @@ Instructions for how to get setup with chDB are available below for the followin How to install and use chDB with Node.js -chDB-node runs ClickHouse queries in-process from Node.js without a separate database server. The npm package uses native, platform-specific libraries; check its supported platforms before installing. - -As of November 30, 2026, npm publishes `chdb@3.6.0` with native core `26.11.1` packages for Linux glibc and macOS, on x64/arm64; Node.js 18+ is required. In addition to the synchronous examples below, it provides asynchronous queries, native named parameters, formatted result streams and direct Arrow APIs. With the optional `apache-arrow` peer, applications can register tables/batches/readers, read typed tables or incremental batches, and bulk-insert Arrow data through C Data/C Stream. The existing `format: 'arrow'` / `toArrow()` route still uses IPC, and direct Arrow can still copy buffers. See the [3.6.0 Arrow guide](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md) for types, cancellation and cleanup rules. The `chdb/connection` ClickHouse-client adapter and Durable APIs remain experimental. +`chdb@3.6.0` embeds core `26.11.1` for Node.js 18+ on Linux glibc and macOS (x64/arm64). It supports sync/async queries, native named parameters and result streams. The optional `apache-arrow` peer enables typed input, batch results and bulk insert; see the [Arrow guide](https://github.com/chdb-io/chdb-node/blob/v3.6.0/docs/arrow.md) for ownership and type limits. Direct Arrow may copy buffers; `format: 'arrow'` / `toArrow()` uses IPC. The ClickHouse-client adapter and Durable APIs remain experimental. ## Installation ```bash @@ -2079,16 +2095,16 @@ chDB-rust provides FFI (Foreign Function Interface) bindings for in-process Clic ## Installation ### Add the crate -Add the published `2.2.1` crate to your application's `Cargo.toml` (checked November 30, 2026). The binding still labels its API experimental: +Add the experimental `2.2.1` crate to `Cargo.toml`: ```toml [dependencies] chdb-rust = "=2.2.1" ``` -On supported Linux/macOS x86_64 and aarch64 targets, the build uses a compatible locally installed `libchdb` and header, or downloads its pinned stable engine version (`v26.11.1`). Generating FFI bindings also requires the Clang/libclang toolchain. To select a local library explicitly, set `CHDB_LIB_DIR` and `CHDB_INCLUDE_DIR`. A system installer that fetches the newest native engine is not necessarily pinned to the version used by this crate. For a dynamically linked binary distributed outside `cargo run`, configure its runtime library path or ship `libchdb` beside it with an appropriate rpath; alternatively, opt into the `static` feature. +On Linux/macOS x86_64 and aarch64, the build uses a local `libchdb` and matching header or downloads stable core `v26.11.1`. Clang/libclang is required for FFI generation. Set `CHDB_LIB_DIR` and `CHDB_INCLUDE_DIR` to select a local engine. Distributed dynamic binaries need a runtime library path or rpath; enable the `static` feature to link the engine into the executable. -The default `arrow` feature uses Arrow 59 and provides direct C Data/C Stream results, incremental `RecordBatch` output, scoped reader registration, and batch/reader insertion. Existing Arrow IPC output is a separate path; direct Arrow does not guarantee zero-copy conversion. See the [Rust Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md) for supported types and ownership. Native named query parameters also work across buffered queries, result streams, Arrow streams and inserts. Durable V1 and its S3 backend remain opt-in through the `durable` and `durable-s3` features. +The default `arrow` feature uses Arrow 59 for direct batch results, reader registration and bulk insert. Direct Arrow may copy buffers; IPC output remains separate. See the [Arrow guide](https://github.com/chdb-io/chdb-rust/blob/v2.2.1/docs/arrow.md) for types and ownership. Native named parameters work across queries, streams and inserts. `durable` and `durable-s3` are opt-in. ## Usage chDB Rust provides both stateless and stateful query execution modes. diff --git a/llms.txt b/llms.txt index 5c76ed33edd..3a5906ffb13 100644 --- a/llms.txt +++ b/llms.txt @@ -22,9 +22,7 @@ Things to remember when using chDB: - [C and C++](https://clickhouse.com/docs/chdb/install/c) - [Experimental WebAssembly — chDB in the browser](https://wasm.chdb.io/) (demo currently pins `chdb-wasm@0.3.0`; npm also publishes `0.4.0`) -The [capability and release matrix](https://github.com/chdb-io/chdb#language-binding-capability-matrix), audited November 30, 2026, distinguishes published packages, RCs and source-only work. Published versions checked: Python 4.5.1, native core 26.11.1, Node.js 3.6.0, Go v2.4.0 and Rust 2.2.1. Python, Node and Rust now have direct typed Arrow APIs alongside IPC output; direct C Data/C Stream does not guarantee zero-copy. - -[Java/JDBC 1.1.0](https://repo.maven.apache.org/maven2/com/clickhouse/chdb/chdb-jdbc/1.1.0/) is published on Maven Central; its optional Arrow module remains experimental. Go typed Arrow requires the separate `github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1` module, root bindings v2.5.0-rc.2, Go 1.23+, cgo and a compatible engine; native named parameters are also a root-RC capability, not stable v2.4.0 driver behavior. [Ruby 0.2.0](https://rubygems.org/gems/chdb-ruby/versions/0.2.0) includes chunked streaming. Bun 2.0.0 and [Zig 0.0.10](https://github.com/chdb-io/chdb-zig/releases/tag/0.0.10) are source releases; npm chdb-bun still serves 1.0.4. [.NET 0.0.3.69](https://www.nuget.org/packages/chdb/0.0.3.69) predates the newer main-branch session/runtime-package implementation. Do not present these as feature-equivalent clients or infer unpublished features from a repository README. +The [capability matrix](https://github.com/chdb-io/chdb#language-binding-capability-matrix) lists published versions, RCs and source-only features, including Java/JDBC, Ruby, .NET and Zig. Use stable core 26.11.1 for native installs unless a package pins its engine. Direct Arrow can still copy buffers; Go's Arrow and [static build](https://clickhouse.com/docs/chdb/install/go#static-linking) require separate opt-in modules. ## Documentation From 987c5b350c125b8ece027a83c30647121f4fd127 Mon Sep 17 00:00:00 2001 From: Shawn Chen Date: Mon, 30 Nov 2026 19:52:51 +1300 Subject: [PATCH 3/3] Simplify Go static installation and use latest module versions --- README.md | 2 +- docs/install/go.mdx | 37 +++++++++++-------------------------- llms-full.txt | 37 +++++++++++-------------------------- 3 files changed, 23 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 1bafea019fa..d326f260dea 100644 --- a/README.md +++ b/README.md @@ -646,7 +646,7 @@ Native connections can share one data path per process. Close all connections be Direct Arrow avoids IPC serialization but may still copy buffers. Go's ordinary `database/sql` rows use Parquet; JDBC `ResultSet` uses `RowBinaryWithNamesAndTypes`. Typed Arrow is a separate API in both bindings. -Go's optional Arrow and static modules require root bindings `v2.5.0-rc.2`; the [Go guide](docs/install/go.mdx) covers their build requirements. Rust enables `arrow` by default; `durable` and `durable-s3` are opt-in. +Go's optional Arrow and static modules select compatible root bindings; the [Go guide](docs/install/go.mdx) covers their build requirements. Rust enables `arrow` by default; `durable` and `durable-s3` are opt-in. Keep Java's driver, Arrow module and native JAR on the same version. Arrow requires its JVM access flag and a separate connection; it cannot export an existing JDBC result. JDBC transactions and batch updates are unsupported. diff --git a/docs/install/go.mdx b/docs/install/go.mdx index c6bd7bb2261..f10dd7bb3b9 100644 --- a/docs/install/go.mdx +++ b/docs/install/go.mdx @@ -14,15 +14,15 @@ chDB-go runs ClickHouse queries in-process. The default binding loads a shared n Install the stable module (Go 1.21+): ```bash -go get github.com/chdb-io/chdb-go/v2@v2.4.0 +go get github.com/chdb-io/chdb-go/v2@latest ``` -Install [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) for your platform and set `CHDB_LIB_PATH` to the absolute path of `libchdb.so`. Alternatively, import the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded); it extracts its packaged shared library at runtime and is not static linking. +Install [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) for your platform and set `CHDB_LIB_PATH` to the absolute path of `libchdb.so`. Alternatively, import the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/main/lib/embedded); it extracts its packaged shared library at runtime and is not static linking. For the optional CLI: ```bash -go install github.com/chdb-io/chdb-go/v2@v2.4.0 +go install github.com/chdb-io/chdb-go/v2@latest ``` ### Optional Arrow and native parameter APIs {#optional-arrow} @@ -30,34 +30,19 @@ go install github.com/chdb-io/chdb-go/v2@v2.4.0 Typed Arrow input, batch results and bulk insert require a separate RC module, Go 1.23+, cgo and core `v26.11.1`: ```bash -go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 +go get github.com/chdb-io/chdb-go/v2/arrow@latest ``` -This selects root bindings `v2.5.0-rc.2`, which also add native named parameters (`{name:Type}`, including `sql.Named`). Stable `v2.4.0` interpolates positional `database/sql` arguments. Neither version supports transactions or prepared statements. +The Arrow module selects compatible root bindings with native named parameters (`{name:Type}`, including `sql.Named`). Positional `database/sql` arguments are interpolated; transactions and prepared statements are unsupported. -Arrow uses C Data/C Stream with copies into native-owned input buffers. See the [Arrow guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for types and lifetimes. If an embedded engine is older, point `CHDB_LIB_PATH` at the stable library above. +Arrow uses C Data/C Stream with copies into native-owned input buffers. See the [Arrow guide](https://github.com/chdb-io/chdb-go/blob/main/v2/arrow/README.md) for types and lifetimes. If an embedded engine is older, point `CHDB_LIB_PATH` at the stable library above. ### Static linking (experimental) {#static-linking} -Static builds require cgo, a C toolchain and root bindings `v2.5.0-rc.2`. Linux and macOS on amd64/arm64 are supported. - -To use stable core `v26.11.1`, extract its platform-specific static release archive and use its matching `chdb.h` and `libchdb.a`. For macOS: - -```bash -go get github.com/chdb-io/chdb-go/v2@v2.5.0-rc.2 -CHDB_STATIC_DIR=/absolute/path/to/extracted-core-26.11.1 -CGO_ENABLED=1 \ - CGO_CFLAGS="-DCHDB_STATIC_HEADER=\"$CHDB_STATIC_DIR/chdb.h\"" \ - CGO_LDFLAGS="-Wl,-force_load,$CHDB_STATIC_DIR/libchdb.a" \ - go build -tags chdb_static,chdb_static_manual -o myapp . -``` - -For Linux linker flags, see [manual linking](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md#manual-linking-advanced). - -A separate prepackaged module avoids manual archive linking: +Static builds require cgo and a C toolchain on Linux or macOS (amd64/arm64). Install the static engine module: ```bash -go get go.chdb.io/chdb/static@v0.261102.0-rc.1.1 +go get go.chdb.io/chdb/static@latest ``` Add this import to the application: @@ -70,7 +55,7 @@ import _ "go.chdb.io/chdb/static" CGO_ENABLED=1 go build -tags chdb_static -o myapp . ``` -This RC module pins core `v26.11.2-rc.1` and selects the matching root binding. `CHDB_LIB_PATH` cannot override a statically linked engine; use manual linking above for stable core. Do not combine the prepackaged import with `chdb_static_manual` or `lib/embedded`. +The module supplies the engine and selects compatible root bindings. Do not combine it with `lib/embedded`; `CHDB_LIB_PATH` cannot override a statically linked engine. ## Usage {#usage} @@ -291,8 +276,8 @@ func main() { chDB-go provides both high-level and low-level APIs: -- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/chdb.md)** - Recommended for most use cases -- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/lowApi.md)** - For advanced use cases requiring fine-grained control +- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/chdb.md)** - Recommended for most use cases +- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/lowApi.md)** - For advanced use cases requiring fine-grained control ## System requirements {#requirements} diff --git a/llms-full.txt b/llms-full.txt index 3975b163432..03f041b8c1e 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -962,48 +962,33 @@ chDB-go runs ClickHouse queries in-process. The default binding loads a shared n Install the stable module (Go 1.21+): ```bash -go get github.com/chdb-io/chdb-go/v2@v2.4.0 +go get github.com/chdb-io/chdb-go/v2@latest ``` -Install [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) for your platform and set `CHDB_LIB_PATH` to the absolute path of `libchdb.so`. Alternatively, import the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/v2.4.0/lib/embedded); it extracts its packaged shared library at runtime and is not static linking. +Install [stable core v26.11.1](https://github.com/chdb-io/chdb-core/releases/tag/v26.11.1) for your platform and set `CHDB_LIB_PATH` to the absolute path of `libchdb.so`. Alternatively, import the separate [embedded-library module](https://github.com/chdb-io/chdb-go/tree/main/lib/embedded); it extracts its packaged shared library at runtime and is not static linking. For the optional CLI: ```bash -go install github.com/chdb-io/chdb-go/v2@v2.4.0 +go install github.com/chdb-io/chdb-go/v2@latest ``` ### Optional Arrow and native parameter APIs Typed Arrow input, batch results and bulk insert require a separate RC module, Go 1.23+, cgo and core `v26.11.1`: ```bash -go get github.com/chdb-io/chdb-go/v2/arrow@v0.1.0-rc.1 +go get github.com/chdb-io/chdb-go/v2/arrow@latest ``` -This selects root bindings `v2.5.0-rc.2`, which also add native named parameters (`{name:Type}`, including `sql.Named`). Stable `v2.4.0` interpolates positional `database/sql` arguments. Neither version supports transactions or prepared statements. +The Arrow module selects compatible root bindings with native named parameters (`{name:Type}`, including `sql.Named`). Positional `database/sql` arguments are interpolated; transactions and prepared statements are unsupported. -Arrow uses C Data/C Stream with copies into native-owned input buffers. See the [Arrow guide](https://github.com/chdb-io/chdb-go/blob/v2/arrow/v0.1.0-rc.1/v2/arrow/README.md) for types and lifetimes. If an embedded engine is older, point `CHDB_LIB_PATH` at the stable library above. +Arrow uses C Data/C Stream with copies into native-owned input buffers. See the [Arrow guide](https://github.com/chdb-io/chdb-go/blob/main/v2/arrow/README.md) for types and lifetimes. If an embedded engine is older, point `CHDB_LIB_PATH` at the stable library above. ### Static linking (experimental) -Static builds require cgo, a C toolchain and root bindings `v2.5.0-rc.2`. Linux and macOS on amd64/arm64 are supported. - -To use stable core `v26.11.1`, extract its platform-specific static release archive and use its matching `chdb.h` and `libchdb.a`. For macOS: - -```bash -go get github.com/chdb-io/chdb-go/v2@v2.5.0-rc.2 -CHDB_STATIC_DIR=/absolute/path/to/extracted-core-26.11.1 -CGO_ENABLED=1 \ - CGO_CFLAGS="-DCHDB_STATIC_HEADER=\"$CHDB_STATIC_DIR/chdb.h\"" \ - CGO_LDFLAGS="-Wl,-force_load,$CHDB_STATIC_DIR/libchdb.a" \ - go build -tags chdb_static,chdb_static_manual -o myapp . -``` - -For Linux linker flags, see [manual linking](https://github.com/chdb-io/chdb-go/blob/main/docs/static-linking.md#manual-linking-advanced). - -A separate prepackaged module avoids manual archive linking: +Static builds require cgo and a C toolchain on Linux or macOS (amd64/arm64). Install the static engine module: ```bash -go get go.chdb.io/chdb/static@v0.261102.0-rc.1.1 +go get go.chdb.io/chdb/static@latest ``` Add this import to the application: @@ -1016,7 +1001,7 @@ import _ "go.chdb.io/chdb/static" CGO_ENABLED=1 go build -tags chdb_static -o myapp . ``` -This RC module pins core `v26.11.2-rc.1` and selects the matching root binding. `CHDB_LIB_PATH` cannot override a statically linked engine; use manual linking above for stable core. Do not combine the prepackaged import with `chdb_static_manual` or `lib/embedded`. +The module supplies the engine and selects compatible root bindings. Do not combine it with `lib/embedded`; `CHDB_LIB_PATH` cannot override a statically linked engine. ## Usage ### Command line interface @@ -1229,8 +1214,8 @@ func main() { ## API documentation chDB-go provides both high-level and low-level APIs: -- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/chdb.md)** - Recommended for most use cases -- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/v2.4.0/lowApi.md)** - For advanced use cases requiring fine-grained control +- **[High-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/chdb.md)** - Recommended for most use cases +- **[Low-Level API Documentation](https://github.com/chdb-io/chdb-go/blob/main/lowApi.md)** - For advanced use cases requiring fine-grained control ## System requirements - Go 1.21 or later