Protryon / klickhouse

Rust crate for accessing Clickhouse
Apache License 2.0
92 stars 21 forks source link

Klickhouse

Klickhouse is a pure Rust SDK for working with Clickhouse with the native protocol in async environments with minimal boilerplate and maximal performance.

Example Usage

See example usage.

Unsupported Features

Running the tests

A Clickhouse server is required to run the integration tests. One can be started easily in a Docker container:

$ docker run  --rm --name clickhouse -p 19000:9000 --ulimit nofile=262144:262144 clickhouse
$ export KLICKHOUSE_TEST_ADDR=127.0.0.1:19000
$ # export KLICKHOUSE_TEST_USER=default
$ # export KLICKHOUSE_TEST_PASSWORD=default
$ # export KLICKHOUSE_TEST_DATABASE=default
$ cargo nextest run

(running the tests simultaneously with cargo test is currently not suported, due to loggers initializations.)

Feature flags

Credit

klickhouse_derive was made by copy/paste/simplify of serde_derive to get maximal functionality and performance at lowest time-cost. In a prototype, serde was directly used, but this was abandoned due to lock-in of serde's data model.