Struct Supabase

Source
pub struct Supabase {
    pub url: String,
    pub key: String,
    pub http_client: Client,
    pub auth: Auth,
    pub options: ClientOptions,
}
Expand description

The main entry point for the Supabase Rust client

Fields§

§url: String

The base URL for the Supabase project

§key: String

The anonymous API key for the Supabase project

§http_client: Client

HTTP client used for requests

§auth: Auth

Auth client for user management and authentication

§options: ClientOptions

Client options

Implementations§

Source§

impl Supabase

Source

pub fn new(supabase_url: &str, supabase_key: &str) -> Self

Create a new Supabase client

§Arguments
  • supabase_url - The base URL for your Supabase project
  • supabase_key - The anonymous API key for your Supabase project
§Example
use supabase_rust_gftd::Supabase;

let supabase = Supabase::new("https://your-project-url.supabase.co", "your-anon-key");
Source

pub fn new_with_options( supabase_url: &str, supabase_key: &str, options: ClientOptions, ) -> Self

Create a new Supabase client with custom options

§Arguments
  • supabase_url - The base URL for your Supabase project
  • supabase_key - The anonymous API key for your Supabase project
  • options - Custom client options
§Example
use supabase_rust_gftd::{Supabase, ClientOptions};

let options = ClientOptions::default().with_auto_refresh_token(true);
let supabase = Supabase::new_with_options(
    "https://your-project-url.supabase.co",
    "your-anon-key",
    options
);
Source

pub fn auth(&self) -> &Auth

Get a reference to the auth client for user management and authentication

Source

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

Create a new PostgrestClient for database operations on a specific table or view

§Arguments
  • table - The name of the table or view
§Example
use supabase_rust_gftd::Supabase;

let supabase = Supabase::new("https://your-project-url.supabase.co", "your-anon-key");
let query = supabase.from("users");
Source

pub fn storage(&self) -> StorageClient

Create a client for the Storage API

Source

pub fn realtime(&self) -> RealtimeClient

Create a client for the Realtime API

Source

pub fn functions(&self) -> FunctionsClient

Create a client for the Edge Functions API

Source

pub fn rpc(&self, function_name: &str, params: Value) -> PostgrestClient

Execute a Postgres function via RPC

§Arguments
  • function_name - The name of the function to call
  • params - Parameters to pass to the function
§Example
use supabase_rust_gftd::Supabase;
use serde_json::json;

let supabase = Supabase::new("https://your-project-url.supabase.co", "your-anon-key");
let result = supabase.rpc("calculate_total", json!({"user_id": 123}));
Source

pub fn filter(self, _filter: DatabaseFilter) -> Self

フィルター条件を追加するメソッド

Source

pub fn eq<T: Into<Value>>(self, column: &str, value: T) -> Self

eq演算子による簡便なフィルター追加メソッド

Source

pub fn neq<T: Into<Value>>(self, column: &str, value: T) -> Self

neq演算子による簡便なフィルター追加メソッド

Source

pub fn gt<T: Into<Value>>(self, column: &str, value: T) -> Self

gt演算子による簡便なフィルター追加メソッド

Source

pub fn gte<T: Into<Value>>(self, column: &str, value: T) -> Self

gte演算子による簡便なフィルター追加メソッド

Source

pub fn lt<T: Into<Value>>(self, column: &str, value: T) -> Self

lt演算子による簡便なフィルター追加メソッド

Source

pub fn lte<T: Into<Value>>(self, column: &str, value: T) -> Self

lte演算子による簡便なフィルター追加メソッド

Source

pub fn in_values<T: Into<Value>>(self, column: &str, values: Vec<T>) -> Self

in演算子による簡便なフィルター追加メソッド(配列の中に含まれるか)

Source

pub fn contains<T: Into<Value>>(self, column: &str, value: T) -> Self

contains演算子による簡便なフィルター追加メソッド(配列が値を含むか)

Source

pub fn like(self, column: &str, pattern: &str) -> Self

like演算子による簡便なフィルター追加メソッド(ワイルドカード検索)

Source

pub fn ilike(self, column: &str, pattern: &str) -> Self

ilike演算子による簡便なフィルター追加メソッド(大文字小文字を区別しないワイルドカード検索)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T