3 unstable releases

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

#1781 in Procedural macros

Download history 129/week @ 2024-11-17 156/week @ 2024-11-24 259/week @ 2024-12-01 171/week @ 2024-12-08 61/week @ 2024-12-15 55/week @ 2024-12-22 46/week @ 2024-12-29 153/week @ 2025-01-05 198/week @ 2025-01-12 243/week @ 2025-01-19 182/week @ 2025-01-26 302/week @ 2025-02-02 424/week @ 2025-02-09 284/week @ 2025-02-16 632/week @ 2025-02-23 741/week @ 2025-03-02

2,096 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
~38K SLoC