//! Example: row-id shortcut helpers for update/delete operations.
use athena_rs::{AthenaClient, QueryResult};
use serde_json::json;
use std::error::Error;

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

    let updated: QueryResult = client
        .update_by_id("users", "user_123")
        .payload(json!({ "status": "active", "updated_by": "shortcut-example" }))
        .execute()
        .await?;
    println!("Updated rows: {}", updated.rows.len());

    let deleted: QueryResult = client
        .delete_by_id("sessions", "session_123")
        .execute()
        .await?;
    println!("Deleted rows: {}", deleted.rows.len());

    Ok(())
}
