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

#472 in Database interfaces

Download history 261/week @ 2024-07-20 263/week @ 2024-07-27 163/week @ 2024-08-03 142/week @ 2024-08-10 177/week @ 2024-08-17 92/week @ 2024-08-24 137/week @ 2024-08-31 178/week @ 2024-09-07 161/week @ 2024-09-14 108/week @ 2024-09-21 144/week @ 2024-09-28 168/week @ 2024-10-05 169/week @ 2024-10-12 336/week @ 2024-10-19 322/week @ 2024-10-26 516/week @ 2024-11-02

1,362 downloads per month
Used in connectorx

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

~13–26MB
~389K SLoC