Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Protryon/klickhouse
Rust crate for accessing Clickhouse
https://github.com/Protryon/klickhouse
Last synced: about 2 months ago
JSON representation
Rust crate for accessing Clickhouse
- Host: GitHub
- URL: https://github.com/Protryon/klickhouse
- Owner: Protryon
- License: apache-2.0
- Created: 2021-05-28T20:38:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T15:15:11.000Z (3 months ago)
- Last Synced: 2024-09-19T15:18:50.339Z (3 months ago)
- Language: Rust
- Size: 468 KB
- Stars: 88
- Watchers: 7
- Forks: 22
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-clickhouse - Protryon/klickhouse - Klickhouse is a Rust crate that enables access to Clickhouse with an async protocol for high performance. (Language bindings / Rust)
README
# Klickhouse
Klickhouse is a pure Rust SDK for working with [Clickhouse](https://clickhouse.tech/docs/en/) with the native protocol in async environments with minimal boilerplate and maximal performance.
## Example Usage
See [example usage](https://github.com/Protryon/klickhouse/blob/master/klickhouse/examples/basic.rs).
## Unsupported Features
- Clickhouse `Enum8` and `Enum16` types -- use `LowCardinality` instead.
## Running the tests
A Clickhouse server is required to run the integration tests. One can be started easily in a Docker container:
```sh
$ 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
- `derive`: Enable [klickhouse_derive], providing a derive macro for the [Row] trait. Default.
- `compression`: `lz4` compression for client/server communication. Default.
- `serde`: Derivation of [serde::Serialize] and [serde::Deserialize] on various objects, and JSON support. Default.
- `tls`: TLS support via [tokio-rustls](https://crates.io/crates/tokio-rustls).
- `refinery`: Migrations via [refinery](https://crates.io/crates/refinery).
- `geo-types`: Conversion of geo types to/from the [geo-types](https://crates.io/crates/geo-types) crate.
- `bb8`: Enables a `ConnectionManager` managed by bb8## 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.