Athena RS SDK
Rust AthenaClient builder and typed gateway execution flows.
Athena RS exposes AthenaClient in src/client/ for Rust-native integration.
Core Capabilities
- Builder-driven initialization (
AthenaClient::builder()) - Typed CRUD + SQL + RPC request builders
- Optional
schema_nametargeting for gateway CRUD/SQL routes - Route parity with canonical gateway constants
- Backend-aware execution support
Example
use athena_rs::client::AthenaClient;
let client = AthenaClient::builder()
.base_url("http://localhost:4052")
.api_key("ath_xxx.yyy")
.build()
.await?;
let rows = client
.fetch("gateway_operation_log")
.limit(10)
.execute()
.await?;
let sql = client
.execute_sql("select now() as current_time")
.await?;Schema-specific execution
athena-rs supports explicit schema targeting without requiring schema.table names:
use athena_rs::client::{AthenaClient, Gateway};
use serde_json::json;
let client = AthenaClient::builder()
.base_url("http://localhost:4052")
.api_key("ath_xxx.yyy")
.client("analytics")
.build()
.await?;
let rows = client
.fetch("events")
.schema_name("reporting")
.where_eq("type", json!("checkout.completed"))
.limit(25)
.execute()
.await?;
let inserted = client
.insert("events")
.schema_name("reporting")
.payload(json!({ "type": "checkout.completed" }))
.execute()
.await?;
let sql_result = client
.execute_sql_in_schema("select count(*) as total from events", "reporting")
.await?;
let typed_sql = Gateway::request()
.sql("select id from events limit 5")
.schema_name("reporting");
let typed_sql_result = client.sql_request(typed_sql).await?;Validation and rejections mirror the gateway contract:
- invalid
schema_name->400 Invalid schema_name - schema-qualified
table_name+schema_nametogether ->400 Invalid schema/table selector - SQL drivers other than PostgreSQL reject
schema_name
Supported Query Operators
eq,neq,gt,gte,lt,lte,in,like,ilike,is- Ordering and pagination (
order_by,limit,offset)
Validation Coverage
Athena RS gateway usage is covered by end-to-end test suites that verify route mapping and behavior across core operations.