11 releases

0.5.1 Oct 19, 2023
0.5.0 Feb 27, 2023
0.4.0 Feb 7, 2022
0.3.3 Jun 8, 2021
0.1.1 Oct 9, 2020

#372 in Database interfaces

Download history 25/week @ 2023-12-31 123/week @ 2024-01-07 27/week @ 2024-01-14 70/week @ 2024-01-21 242/week @ 2024-01-28 136/week @ 2024-02-04 200/week @ 2024-02-11 400/week @ 2024-02-18 277/week @ 2024-02-25 126/week @ 2024-03-03 281/week @ 2024-03-10 46/week @ 2024-03-17 34/week @ 2024-03-24 98/week @ 2024-03-31

464 downloads per month

MIT license

105KB
3K SLoC

Prusto

A presto/trino client library written in rust.

Installation

# Cargo.toml
[dependencies]
prusto = "0.5"

In order to use this crate as presto client, enable "presto" feature.

# Cargo.toml
[dependencies]
prusto = { version = "0.5", features = ["presto"] }

Example

use prusto::{ClientBuilder, Presto};

#[derive(Presto, Debug)]
struct Foo {
    a: i64,
    b: f64,
    c: String,
}

#[tokio::main]
async fn main() {
    let cli = ClientBuilder::new("user", "localhost")
        .port(8090)
        .catalog("catalog")
        .build()
        .unwrap();

    let sql = "select 1 as a, cast(1.1 as double) as b, 'bar' as c ";

    let data = cli.get_all::<Foo>(sql.into()).await.unwrap().into_vec();

    for r in data {
        println!("{:?}", r)
    }
}

License

MIT

Dependencies

~12–27MB
~418K SLoC