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

#390 in Database interfaces

Download history 322/week @ 2024-10-26 525/week @ 2024-11-02 742/week @ 2024-11-09 120/week @ 2024-11-16 138/week @ 2024-11-23 227/week @ 2024-11-30 174/week @ 2024-12-07 92/week @ 2024-12-14 45/week @ 2024-12-21 44/week @ 2024-12-28 124/week @ 2025-01-04 224/week @ 2025-01-11 218/week @ 2025-01-18 192/week @ 2025-01-25 293/week @ 2025-02-01 396/week @ 2025-02-08

1,125 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–26MB
~370K SLoC