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("NEXT_PUBLIC_AURABASE_URL").expect("NEXT_PUBLIC_AURABASE_URL"),
        &env::var("AURABASE_SERVICE_ROLE_KEY").expect("AURABASE_SERVICE_ROLE_KEY"),
        None, // AuraClientOptions (auth store)
    )
}
#
Example

Typed select

The row type is given to from::<Row>(); order(column, direction) takes the direction as a second argument; execute() returns an AuraResponse whose data is the list of rows.

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

#[derive(Debug, Deserialize, Serialize)]
pub struct Todo {
    pub id: i64,
    pub title: String,
    pub done: bool,
}

pub async fn recent(aura: &AuraClient) -> Result<Vec<Todo>, AuraError> {
    let res = aura
        .from::<Todo>("todos")
        .select("id,title,done")
        .order("created_at", "desc")
        .limit(5)
        .execute()
        .await?;
    Ok(res.data.unwrap_or_default())
}
#
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