Expand description
Async HTTP client for Bunny.net Database SQL pipeline API.
This crate wraps the /v2/pipeline endpoint with ergonomic methods:
§Quick Start
use bunnydb_http::{BunnyDbClient, Params, Value};
let pipeline_url = std::env::var("BUNNYDB_PIPELINE_URL")?;
let token = std::env::var("BUNNYDB_TOKEN")?;
let db = BunnyDbClient::new_bearer(pipeline_url, token);
db.execute(
"CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT NOT NULL)",
(),
).await?;
let result = db.query(
"SELECT id, name FROM users WHERE name = :name",
Params::named([("name", Value::text("Kit"))]),
).await?;
println!("rows={}", result.rows.len());Structs§
- Bunny
DbClient - HTTP client for Bunny.net Database SQL pipeline endpoint.
- Client
Options - Configures HTTP timeout and retry behavior.
- Col
- Column metadata returned by query responses.
- Exec
Result - Execute response shape.
- Query
Result - Query response shape.
- Statement
- Single statement inside a batch request.
Enums§
- Bunny
DbError - Error type returned by this crate.
- Params
- SQL parameter container.
- Statement
Outcome - Batch outcome per statement.
- Value
- Logical value type used for SQL parameters and decoded rows.
Type Aliases§
- Result
- Crate-wide result type.