Skip to main content

Crate bunnydb_http

Crate bunnydb_http 

Source
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§

BunnyDbClient
HTTP client for Bunny.net Database SQL pipeline endpoint.
ClientOptions
Configures HTTP timeout and retry behavior.
Col
Column metadata returned by query responses.
ExecResult
Execute response shape.
QueryResult
Query response shape.
Statement
Single statement inside a batch request.

Enums§

BunnyDbError
Error type returned by this crate.
Params
SQL parameter container.
StatementOutcome
Batch outcome per statement.
Value
Logical value type used for SQL parameters and decoded rows.

Type Aliases§

Result
Crate-wide result type.