3 unstable releases

0.2.1 Dec 6, 2024
0.2.0 Feb 7, 2022
0.1.0 Oct 1, 2020

#5 in #presto

Download history 276/week @ 2025-08-02 565/week @ 2025-08-09 660/week @ 2025-08-16 400/week @ 2025-08-23 351/week @ 2025-08-30 454/week @ 2025-09-06 266/week @ 2025-09-13 275/week @ 2025-09-20 1056/week @ 2025-09-27 1639/week @ 2025-10-04 6770/week @ 2025-10-11 4651/week @ 2025-10-18 3787/week @ 2025-10-25 1192/week @ 2025-11-01 11705/week @ 2025-11-08 10168/week @ 2025-11-15

27,549 downloads per month
Used in 3 crates (2 directly)

MIT license

9KB
141 lines

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

~1.5MB
~39K SLoC