#clickhouse #tokio

clickhouse-driver

Asynchronous tokio-based Yandex ClickHouse driver

1 unstable release

0.1.0-alpha.3 Aug 7, 2020

#35 in #clickhouse

MIT license

575KB
12K SLoC

Rust 6.5K SLoC // 0.0% comments C 5K SLoC // 0.2% comments Visual Studio Project 181 SLoC C++ 90 SLoC // 0.2% comments Visual Studio Solution 24 SLoC

Clickhouse-driver

Asynchronous pure rust tokio-based Clickhouse client library

Quick start

add next lines in dependencies section of Cargo.toml

 clickhouse-driver = { version="0.1.0-alpha.1", path="../path_to_package/clickhouse-driver"}
 clickhouse-driver-lz4 = { version="0.1.0", path="../path_to_package/lz4a"}
 clickhouse-driver-cthrs = { version="0.1.0", path="../path_to_package/cityhash-rs"}

Supported Clickhouse data types

  • Date | DateTime | DateTime64- read/write

  • (U)Int(8|16|32|64) - read/write

  • Float32 | Float64 - read/write

  • UUID - read/write

  • String | FixedString- read/write

  • Ipv4 | Ipv6 - read/write

  • Nullable(*) - read/write

  • Decimal - read/write

  • Enum8, Enum16 - read/write

  • LowCardinality(String) - read

Connection url

tcp://[username:password@]host.name[:port]/database?paramname=paramvalue&...

for example

tcp://user:default@localhost/log?ping_timout=200ms&execute_timeout=5s&query_timeout=20s&pool_max=4&compression=lz4
  • default port: 9000
  • default username: "default"
  • default database: "default"

Dependencies

~10–22MB
~289K SLoC