Skip to content

struct

Supabase

pub struct Supabase {
    /* private fields */
}

A Supabase project: its tables (through PostgREST), RPC, auth and storage.

Methods

new

pub fn new(url: &str, anon_key: &str) -> Supabase

The project URL (https://xyz.supabase.co) and its anon (or publishable) key.

with_token

pub fn with_token(self, access_token: &str) -> Supabase

Act as a signed-in user (their access token) instead of anon.

url

pub fn url(&self) -> &str

The project's address.

from

pub fn from(&self, table: &str) -> Query

Start a query on a table (or view).

rpc

pub fn rpc(&self, function: &str, args: &Json) -> Request

Call a Postgres function.

sign_in

pub fn sign_in(&self, email: &str, password: &str) -> Request

Sign in with email and password; parse the reply with [Session::parse].

sign_up

pub fn sign_up(&self, email: &str, password: &str) -> Request

Create an account (Supabase may send a confirmation email first).

refresh

pub fn refresh(&self, refresh_token: &str) -> Request

Exchange a refresh token for a new session.

sign_out

pub fn sign_out(&self) -> Request

End the session of the token given to [Supabase::with_token].

public_url

pub fn public_url(&self, bucket: &str, path: &str) -> String

The public URL of a file in a public storage bucket.

Trait implementations