Expand description
Dune Analytics API client for Rust
An unofficial Rust client for the Dune Analytics API.
§Example
let client = dnapi::Client::new("your-api-key")?;
// Execute a query and wait for results
let result = client.executions().run_query(1234, None).await?;
for row in result.result.unwrap().rows {
println!("{:?}", row);
}
// Execute raw SQL
let result = client.executions().run_sql("SELECT 1 as value", None).await?;
println!("{:?}", result.result);
// Get cached results for a query
let result = client.executions().query_results(1234).await?;
println!("{:?}", result.result);§Features
- Queries: Create, read, update, archive/unarchive queries
- Executions: Execute queries, run SQL, get results (JSON or CSV)
- Tables: Upload data, create tables, insert rows
- Materialized Views: Create, refresh, manage materialized views
- Pipelines: Execute coordinated query workflows
- Usage: Track API consumption and credits
Re-exports§
Modules§
- error
- Error types for the Dune API client
- executions
- Executions API for running queries and retrieving results
- matviews
- Materialized Views API for creating and managing materialized views
- pipelines
- Pipelines API for executing coordinated query workflows
- queries
- Queries API for managing Dune queries
- tables
- Tables API for uploading and managing custom data
- usage
- Usage API for tracking API consumption and credits
Structs§
- Client
- Dune Analytics API client
- Config
- Configuration for the Dune API client
- Http
Client Config - HTTP client configuration
- Retry
Config - Configuration for retry behavior
- Retry
Error - Error wrapper that includes retry information
Constants§
- DEFAULT_
BASE_ URL - Default base URL for the Dune Analytics API
Traits§
- Retryable
Error - Determines if an error should be retried
Functions§
- config_
with_ api_ key - Create a config with an API key
- with_
retry - Execute an async operation with retries
- with_
simple_ retry - Simple retry wrapper for operations that return Result with any error type