Aurabase Logo
aurabasedocs
docs›Reference›Rust SDK

Rust SDK

aurabase crate — typed async client for Tokio/axum/actix.

8 min read·Level reference·Revised on Apr 15, 2026
This English text was generated automatically from the French original and has not been reviewed yet.
#
Installation

Cargo

Cargo.tomltoml
[dependencies]
aurabase = "0.1"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
Attention

Breaking changes are announced in the changelog with a period of 30 days before release.

#
Initialization

Default client

src/aurabase.rsrust
use aurabase::AuraClient;
use std::env;

pub fn client() -> AuraClient {
    AuraClient::new(
        &env::var("AURA_URL").unwrap(),
        &env::var("AURA_SERVICE_ROLE_KEY").unwrap(),
        None, // AuraClientOptions (timeout, headers, auth store)
    )
}
#
Example

Select+insert

src/handlers.rsrust
use aurabase::AuraClient;
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
pub struct Sensor { pub id: uuid::Uuid, pub value: f64 }

pub async fn recent(aura: &AuraClient) -> Result<Vec<Sensor>> {
    aura.from("sensors")
        .select("id,value")
        .order("captured_at.desc")
        .limit(50)
        .execute::<Sensor>()
        .await
}
#
Codegen

aura db generate --lang rust

terminalbash
# ROADMAP — the Rust codegen (--lang rust) is not yet available.
aura db generate --lang rust > src/aurabase_types.rs
# Will generate: Deserialize/Serialize structs for each table + enums for custom Postgres types
#
Stability

API still evolving

These surfaces are still subject to change. Conditional compilation behind the unstable feature in Cargo.toml.

  • aura.channel() — WebSocket/SSE client
  • aura.functions.invoke() — edge function call
  • aura.storage.upload_resumable() — tus-style chunks
Last updated · Apr 15, 2026