Crates.io | chdb |
lib.rs | chdb |
version | 0.1.2 |
source | src |
created_at | 2023-11-16 01:06:21.810656 |
updated_at | 2023-11-16 01:19:07.102193 |
description | Use clickhouse as library (chdb) |
homepage | |
repository | https://github.com/fixcik/chdb-rs |
max_upload_size | |
id | 1037171 |
size | 305,926 |
Use clickhouse as library, based on clickhouse local
You should have libchdb
cargo add chdb
or add to Cargo.toml
chdb = "0.1"
Powered by:
ClickHouse - https://clickhouse.com/
libchdb - https://github.com/metrico/libchdb
use chdb::{flag, option, Query};
let result = Query::new("SELECT number FROM numbers(10)")
.option(option!("format", "TSVWithNames"))
.option(flag!("verbose"))
.exec()
.unwrap();
println!("Elapsed: {}", result.elapsed);
println!("Rows: {}", result.rows_read);
println!("Bytes: {}", result.bytes_read);
println!("Result:\n{}", result.to_string().unwrap());
Otputs:
SELECT number FROM numbers(10)
Elapsed: 0.007413874
Rows: 10
Bytes: 80
Result:
number
0
1
2
3
4
5
6
7
8
9
List of available options here