Skip to main content
The published duners crate runs queries asynchronously and deserializes results into your own row types.

Installation

Set DUNE_API_KEY in your environment before running the example.

Run SQL

run_sql submits SQL, waits for completion, and retrieves all result pages. It supports a performance option; run_query for saved queries does not.

Run a saved query

For query 971694, the result columns are symbol and max_price:
To use the query’s EnumParam parameter, pass Some(vec![duners::Parameter::list("EnumParam", "WETH")]) as the second argument to run_query. For a previously executed query, use client.get_latest_results::<PriceRow>(971694).await? to fetch the latest existing JSON result without rerunning it. This call reads one result page. The SDK also provides stream_query and stream_sql for processing newly executed results page by page without buffering the entire dataset. See the crate documentation for query management and uploads.