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

#362 in Database interfaces

Download history 94/week @ 2024-08-23 122/week @ 2024-08-30 175/week @ 2024-09-06 177/week @ 2024-09-13 109/week @ 2024-09-20 125/week @ 2024-09-27 181/week @ 2024-10-04 157/week @ 2024-10-11 231/week @ 2024-10-18 387/week @ 2024-10-25 573/week @ 2024-11-01 750/week @ 2024-11-08 120/week @ 2024-11-15 129/week @ 2024-11-22 123/week @ 2024-11-29 277/week @ 2024-12-06

772 downloads per month
Used in connectorx

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

~12–25MB
~366K SLoC