Skip to main content

Crate supabase_rust

Crate supabase_rust 

Source
Expand description

§supabase-rust

An unofficial Rust client for Supabase.

Provides typed access to Supabase Auth and PostgREST (database) APIs.

§Quick start

use supabase_rust::{Supabase, AuthResponse, Error};

let client = Supabase::new(
    Some("https://your-project.supabase.co"),
    Some("your-api-key"),
    None,
)?;

// Sign in
let auth: AuthResponse = client
    .sign_in_password("user@example.com", "password")
    .await?;
println!("access token: {}", auth.access_token);

// Query the database
let response = client
    .from("todos")
    .select("*")
    .eq("user_id", &auth.access_token)
    .execute()
    .await?;

Re-exports§

pub use auth::AuthResponse;
pub use auth::Claims;
pub use db::QueryBuilder;
pub use error::Error;

Modules§

auth
db
error

Structs§

Supabase
The Supabase client. Entry point for all operations.