12 releases

0.5.2 Dec 6, 2024
0.5.1 Oct 19, 2023
0.5.0 Feb 27, 2023
0.4.0 Feb 7, 2022
0.1.2 Nov 11, 2020

#605 in Database interfaces

Download history 214/week @ 2025-09-17 284/week @ 2025-09-24 1550/week @ 2025-10-01 3052/week @ 2025-10-08 6618/week @ 2025-10-15 4306/week @ 2025-10-22 2713/week @ 2025-10-29 4532/week @ 2025-11-05 12123/week @ 2025-11-12 9290/week @ 2025-11-19 4732/week @ 2025-11-26 2771/week @ 2025-12-03 3304/week @ 2025-12-10 7257/week @ 2025-12-17 2426/week @ 2025-12-24 2212/week @ 2025-12-31

16,624 downloads per month
Used in 3 crates (2 directly)

MIT license

110KB
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

~19–36MB
~444K SLoC