MCPcopy Index your code
hub / github.com/chdb-io/chdb-rust

github.com/chdb-io/chdb-rust @v1.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.3.1 ↗ · + Follow
106 symbols 276 edges 21 files 28 documented · 26%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust Crates.io docs.rs

chdb-rust

Experimental chDB FFI bindings for Rust.

Documentation

Full API Documentation - Complete Rust API reference on docs.rs

Status

Experimental - This library is currently experimental, unstable, and subject to changes.

The library automatically downloads and manages libchdb dependencies during the build process.

Quick Start

Add chdb-rust to your Cargo.toml:

[dependencies]
chdb-rust = "1.1.0"

The library will automatically download the required libchdb binary during the build process.

Supported Platforms

  • Linux: x86_64, aarch64
  • macOS: x86_64, arm64 (Apple Silicon)

Building

Standard Build

cargo build

Verbose Build (for debugging)

RUST_BACKTRACE=full cargo build --verbose

Manual Installation (Optional)

If you prefer to install libchdb manually instead of automatic download:

System-wide installation:

./update_libchdb.sh --global

Local directory installation:

./update_libchdb.sh --local

Testing

Run the test suite:

cargo test -- --test-threads=1

Examples

  • Runnable examples: See the examples/ directory bash cargo run --example <name>
  • Detailed documentation: See docs/examples.md for comprehensive examples and explanations
  • Test examples: See tests/ directory for additional usage examples

Contributing

We welcome contributions! Here's how you can help:

Getting Started

  1. Fork the repository and clone your fork bash git clone https://github.com/YOUR_USERNAME/chdb-rust.git cd chdb-rust

  2. Create a branch for your changes bash git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix

  3. Make your changes and ensure they work

  4. Run tests: cargo test
  5. Check formatting: cargo fmt --check
  6. Run clippy: cargo clippy

  7. Commit your changes with clear, descriptive commit messages bash git commit -m "Add feature: description of what you did"

  8. Push to your fork and open a Pull Request bash git push origin feature/your-feature-name

Development Guidelines

  • Code Style: Follow Rust conventions and run cargo fmt before committing
  • Testing: Add tests for new features and ensure all existing tests pass
  • Documentation: Update relevant documentation for user-facing changes
  • Commit Messages: Write clear, descriptive commit messages
  • Pull Requests:
  • Provide a clear description of your changes
  • Reference any related issues
  • Ensure CI checks pass

Reporting Issues

Found a bug or have a feature request? Please open an issue on GitHub with: - A clear description of the problem or feature - Steps to reproduce (for bugs) - Expected vs actual behavior - Your environment (OS, Rust version, etc.)

Questions?

Feel free to open a discussion or issue if you have questions about contributing!

Core symbols most depended-on inside this repo

execute
called by 39
src/session.rs
execute
called by 31
src/lib.rs
data_utf8_lossy
called by 11
src/query_result.rs
with_data_path
called by 8
src/session.rs
with_auto_cleanup
called by 8
src/session.rs
build
called by 8
src/session.rs
data_ref
called by 5
src/query_result.rs
register_arrow_stream
called by 4
src/connection.rs

Shape

Function 50
Method 33
Class 18
Enum 5

Languages

Rust100%

Modules by API surface

tests/examples.rs15 symbols
tests/arrow_stream.rs15 symbols
src/query_result.rs12 symbols
src/bindings.rs11 symbols
src/session.rs10 symbols
src/connection.rs9 symbols
src/arrow_stream.rs8 symbols
build.rs7 symbols
src/arg.rs4 symbols
src/format.rs3 symbols
src/log_level.rs2 symbols
examples/06_error_handling.rs2 symbols

For agents

$ claude mcp add chdb-rust \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact