athena_rs 3.3.0

Database gateway API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Example: athena-js-style aliases (`fetch` and `sql`).
use athena_rs::AthenaClient;
use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let client = AthenaClient::new("http://localhost:4052", "secret", "reporting").await?;

    let fetched = client.fetch("projects").limit(5).execute().await?;
    println!("Fetched rows: {}", fetched.rows.len());

    let sql_rows = client.sql("SELECT now() AS server_time").await?;
    println!("SQL rows: {}", sql_rows.rows.len());

    Ok(())
}