| Crates.io | trino-rust-client |
| lib.rs | trino-rust-client |
| version | 0.7.3 |
| created_at | 2024-12-08 17:02:24.967515+00 |
| updated_at | 2025-06-24 14:35:35.274187+00 |
| description | A trino client library |
| homepage | https://github.com/nudibranches-tech/trino-rust-client |
| repository | https://github.com/nudibranches-tech/trino-rust-client |
| max_upload_size | |
| id | 1476444 |
| size | 245,670 |
A trino client library written in rust.
This project have been forked on 08/12/24 from the great : prusto made by @nooberfsh.
Fork rationale :
# Cargo.toml
[dependencies]
trino-rust-client = "0.7.3"
use trino_rust_client::{ClientBuilder, Trino};
#[derive(Trino, 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)
}
}
use trino_rust_client::{ClientBuilder, Trino};
#[derive(Trino, Debug)]
struct Foo {
a: i64,
b: f64,
c: String,
}
#[tokio::main]
async fn main() {
let auth = Auth::Jwt("your access token");
let cli = ClientBuilder::new("user", "localhost")
.port(8443)
.secure(true)
.auth(auth)
.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)
}
}
MIT