pub struct Supabase { /* private fields */ }Implementations§
Source§impl Supabase
impl Supabase
Sourcepub fn jwt_valid(&self, jwt: &str) -> Result<Claims, Error>
pub fn jwt_valid(&self, jwt: &str) -> Result<Claims, Error>
Validates a JWT token and returns its claims.
Returns an error if the token is invalid or expired.
Sourcepub async fn sign_in_password(
&self,
email: &str,
password: &str,
) -> Result<Response, Error>
pub async fn sign_in_password( &self, email: &str, password: &str, ) -> Result<Response, Error>
Signs in a user with email and password.
Returns the response containing access and refresh tokens.
Sourcepub async fn refresh_token(
&self,
refresh_token: &str,
) -> Result<Response, Error>
pub async fn refresh_token( &self, refresh_token: &str, ) -> Result<Response, Error>
Refreshes an access token using a refresh token.
Note: This may fail if “Enable automatic reuse detection” is enabled in Supabase.
Source§impl Supabase
impl Supabase
Sourcepub fn new(url: Option<&str>, api_key: Option<&str>, jwt: Option<&str>) -> Self
pub fn new(url: Option<&str>, api_key: Option<&str>, jwt: Option<&str>) -> Self
Creates a new Supabase client.
If no parameters are provided, it will attempt to read from environment
variables: SUPABASE_URL, SUPABASE_API_KEY, and SUPABASE_JWT_SECRET.
Sourcepub fn set_bearer_token(&mut self, token: impl Into<String>)
pub fn set_bearer_token(&mut self, token: impl Into<String>)
Sets the bearer token for authenticated requests.
Source§impl Supabase
impl Supabase
Sourcepub fn from(&self, table: impl Into<String>) -> QueryBuilder<'_>
pub fn from(&self, table: impl Into<String>) -> QueryBuilder<'_>
Creates a QueryBuilder for the specified table.
This is the entry point for all database operations.
§Examples
ⓘ
// Select all from users
client.from("users").select("*").execute().await?;
// Select with filter
client.from("users").select("id,name").eq("status", "active").execute().await?;
// Insert
client.from("users").insert(&user_data)?.execute().await?;
// Update
client.from("users").update(&updates)?.eq("id", "123").execute().await?;
// Delete
client.from("users").delete().eq("id", "123").execute().await?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for Supabase
impl !RefUnwindSafe for Supabase
impl Send for Supabase
impl Sync for Supabase
impl Unpin for Supabase
impl !UnwindSafe for Supabase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more