Expand description
§datapress-client
Async + blocking Rust client for a running DataPress dataset server.
It wraps the JSON and Arrow IPC HTTP endpoints so you don’t have to
hand-roll request bodies and response decoding. The crate is
deliberately lightweight: only reqwest + serde by default, with
Arrow IPC decoding behind the (default-on) arrow feature and a
synchronous client behind the blocking feature.
§Async
use datapress_client::{Client, QueryRequest, Predicate};
let client = Client::new("http://127.0.0.1:8000")?;
let names = client.datasets().await?;
let req = QueryRequest::builder()
.columns(["State", "Severity"])
.predicate(Predicate::new("Severity", "gte", 3))
.page_size(10_000)
.build();
let resp = client.query_json("accidents", &req).await?;
println!("{} rows", resp.data.len());§Blocking (feature blocking)
use datapress_client::blocking::Client;
let client = Client::new("http://127.0.0.1:8000")?;
let count = client.count("accidents", &[])?;
println!("{count} rows");Modules§
- blocking
- Synchronous, blocking wrapper around the async
crate::Client.
Structs§
- Aggregation
- One aggregation in a
group_byquery. - Client
- Asynchronous client for a running DataPress server.
- Client
Builder - Builder for
Client. - OrderBy
- One
ORDER BYentry.diris"asc"(default) or"desc". - Predicate
- A single filter predicate.
- Query
Request - A structured query, sent as the body of
POST /datasets/{name}/query. - Query
Request Builder - Fluent builder for
QueryRequest. - Query
Response - JSON envelope returned by
POST /datasets/{name}/query. - SqlRequest
- Raw-SQL request body (
POST /sql). - SqlResponse
- JSON envelope returned by
POST /sql.
Enums§
- Client
Error - Everything that can go wrong talking to a DataPress server.
Functions§
- decode_
ipc_ stream - Decode an Arrow IPC stream into its record batches.
Type Aliases§
- Result
- Result alias used throughout the crate.