//! Example: condition-based delete via `/gateway/delete`.
use athena_rs::AthenaClient;
use athena_rs::client::backend::QueryResult;
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 delete_result: QueryResult = client
        .delete("sessions")
        .where_eq("workspace_id", "ws_123")
        .where_lt("expires_at_epoch", 1_700_000_000_i64)
        .execute()
        .await?;

    println!("Deleted rows: {}", delete_result.rows.len());

    Ok(())
}
