iotdb-rs

Crates.ioiotdb-rs
lib.rsiotdb-rs
version0.0.2
sourcesrc
created_at2021-02-05 19:03:41.187487
updated_at2021-02-05 20:06:35.240695
descriptionRust client for Apache IotDB
homepage
repositoryhttps://github.com/francis-du/iotdb-rs
max_upload_size
id351264
size453,159
Francis Du (francis-du)

documentation

https://docs.rs/crate/iotdb

README

Logo

iotdb-rs

(WIP) Rust client for Apache IotDB

Crates.io Api Docs Crates.io License Rust Build Crates Publish


How to use

Add iotdb to your Cargo.toml

[dependencies]
iotdb = "0.0.2"

Example

use thrift::Error;

use iotdb::client::Client;
use iotdb::pretty;
use iotdb::session::Session;
use std::collections::HashMap;

fn main() -> Result<(), Error> {
    // create client 4 ways
    // let client = Client::new("localhost", "6667").create();
    // let client = Client::new("localhost", "6667").enable_rpc_compaction().create();
    // let client = Client::default().enable_rpc_compaction().create()?;
    let client = Client::default().create()?;

    // open a session
    let mut session = Session::new(client);

    // config session
    let mut config_map = HashMap::new();
    config_map.insert("", "");

    // session
    //     .user("root")
    //     .password("root")
    //     .fetch_size(2048)
    //     .zone_id("UTC+8")
    //     .config("", "")
    //     .config_map(config_map)
    //     .open()?;

    // using default config
    session.open()?;

    let res = session.query("SHOW TIMESERIES root")?;
    println!("{:#?}", res);
    pretty::result_set(res);

    session.close()?;

    Ok(())
}

Commit count: 87

cargo fmt