All Projects → suharev7 → Clickhouse Rs

suharev7 / Clickhouse Rs

Licence: mit
Asynchronous ClickHouse client library for Rust programming language.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Clickhouse Rs

H2
HTTP 2.0 client & server implementation for Rust.
Stars: ✭ 886 (+684.07%)
Mutual labels:  tokio
Logstash Output Clickhouse
Implementation of ClickHouse output for logstash
Stars: ✭ 75 (-33.63%)
Mutual labels:  clickhouse
Flow Pipeline
A set of tools and examples to run a flow-pipeline (sFlow, NetFlow)
Stars: ✭ 86 (-23.89%)
Mutual labels:  clickhouse
Gorose
GoRose(go orm), a mini database ORM for golang, which inspired by the famous php framwork laravle's eloquent. It will be friendly for php developer and python or ruby developer. Currently provides six major database drivers: mysql,sqlite3,postgres,oracle,mssql, Clickhouse.
Stars: ✭ 947 (+738.05%)
Mutual labels:  clickhouse
Clickhouse Jdbc Bridge
A JDBC proxy from ClickHouse to external databases
Stars: ✭ 69 (-38.94%)
Mutual labels:  clickhouse
Rumqttd
rust mqtt broker
Stars: ✭ 77 (-31.86%)
Mutual labels:  tokio
Homebrew Clickhouse
Stars: ✭ 26 (-76.99%)
Mutual labels:  clickhouse
Oxidizer
📦 A Rust ORM based on tokio-postgres and refinery
Stars: ✭ 100 (-11.5%)
Mutual labels:  tokio
Clickhouse Cpp
C++ client library for ClickHouse
Stars: ✭ 75 (-33.63%)
Mutual labels:  clickhouse
Clickhouse.client
.NET client for ClickHouse
Stars: ✭ 85 (-24.78%)
Mutual labels:  clickhouse
Domain
A DNS library for Rust
Stars: ✭ 37 (-67.26%)
Mutual labels:  tokio
Tabix
Tabix.io UI
Stars: ✭ 1,152 (+919.47%)
Mutual labels:  clickhouse
Clickhouse Go
Golang driver for ClickHouse
Stars: ✭ 1,234 (+992.04%)
Mutual labels:  clickhouse
Tk Listen
A library that allows to listen network sockets with proper resource limits and error handling
Stars: ✭ 27 (-76.11%)
Mutual labels:  tokio
Hangout Output Clickhouse
Implementation of ClickHouse output for hangout
Stars: ✭ 86 (-23.89%)
Mutual labels:  clickhouse
Analytics
Simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics.
Stars: ✭ 9,469 (+8279.65%)
Mutual labels:  clickhouse
Javelin
[Mirror] RTMP streaming server written in Rust
Stars: ✭ 77 (-31.86%)
Mutual labels:  tokio
Flink Learning
flink learning blog. http://www.54tianzhisheng.cn/ 含 Flink 入门、概念、原理、实战、性能调优、源码解析等内容。涉及 Flink Connector、Metrics、Library、DataStream API、Table API & SQL 等内容的学习案例,还有 Flink 落地应用的大型项目案例(PVUV、日志存储、百亿数据实时去重、监控告警)分享。欢迎大家支持我的专栏《大数据实时计算引擎 Flink 实战与性能优化》
Stars: ✭ 11,378 (+9969.03%)
Mutual labels:  clickhouse
Trickster
Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator
Stars: ✭ 1,306 (+1055.75%)
Mutual labels:  clickhouse
Clickhouse Scala Client
Clickhouse Scala Client with Reactive Streams support
Stars: ✭ 84 (-25.66%)
Mutual labels:  clickhouse

Async ClickHouse Client

Build Status Crate info Documentation dependency status Coverage Status

Asynchronous Yandex ClickHouse client library for rust programming language.

Installation

Library hosted on crates.io.

[dependencies]
clickhouse-rs = "*"

Supported data types

  • Date
  • DateTime
  • Decimal(P, S)
  • Float32, Float64
  • String, FixedString(N)
  • UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64
  • Nullable(T)
  • Array(UInt/Int/Float/String/Date/DateTime)
  • IPv4/IPv6
  • UUID

DNS

schema://user:[email protected][:port]/database?param1=value1&...&paramN=valueN

parameters:

  • compression - Whether or not use compression (defaults to none). Possible choices:

    • none
    • lz4
  • readonly - Restricts permissions for read data, write data and change settings queries. (defaults to none). Possible choices:

    • 0 - All queries are allowed.
    • 1 - Only read data queries are allowed.
    • 2 - Read data and change settings queries are allowed.
  • connection_timeout - Timeout for connection (defaults to 500 ms)

  • query_timeout - Timeout for queries (defaults to 180 sec).

  • insert_timeout - Timeout for inserts (defaults to 180 sec).

  • execute_timeout - Timeout for execute (defaults to 180 sec).

  • keepalive - TCP keep alive timeout in milliseconds.

  • nodelay - Whether to enable TCP_NODELAY (defaults to true).

  • pool_min - Lower bound of opened connections for Pool (defaults to 10).

  • pool_max - Upper bound of opened connections for Pool (defaults to 20).

  • ping_before_query - Ping server every time before execute any query. (defaults to true).

  • send_retries - Count of retry to send request to server. (defaults to 3).

  • retry_timeout - Amount of time to wait before next retry. (defaults to 5 sec).

  • ping_timeout - Timeout for ping (defaults to 500 ms).

  • alt_hosts - Comma separated list of single address host for load-balancing.

example:

tcp://user:[email protected]:9000/clicks?compression=lz4&ping_timeout=42ms

Optional features

clickhouse-rs puts some functionality behind optional features to optimize compile time for the most common use cases. The following features are available.

  • tokio_io (enabled by default) — I/O based on Tokio.
  • async_std — I/O based on async-std (doesn't work together with tokio_io).
  • tls — TLS support (allowed only with tokio_io).

Example

use clickhouse_rs::{Block, Pool};
use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let ddl = r"
        CREATE TABLE IF NOT EXISTS payment (
            customer_id  UInt32,
            amount       UInt32,
            account_name Nullable(FixedString(3))
        ) Engine=Memory";

    let block = Block::new()
        .column("customer_id",  vec![1_u32,  3,  5,  7,  9])
        .column("amount",       vec![2_u32,  4,  6,  8, 10])
        .column("account_name", vec![Some("foo"), None, None, None, Some("bar")]);

    let pool = Pool::new(database_url);

    let mut client = pool.get_handle().await?;
    client.execute(ddl).await?;
    client.insert("payment", block).await?;
    let block = client.query("SELECT * FROM payment").fetch_all().await?;

    for row in block.rows() {
        let id: u32             = row.get("customer_id")?;
        let amount: u32         = row.get("amount")?;
        let name: Option<&str>  = row.get("account_name")?;
        println!("Found payment {}: {} {:?}", id, amount, name);
    }

    Ok(())
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].