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
impl Supabase
Sourcepub fn new_with_options(
supabase_url: &str,
supabase_key: &str,
options: ClientOptions,
) -> Self
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 projectsupabase_key
- The anonymous API key for your Supabase projectoptions
- 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
);
Sourcepub fn auth(&self) -> &Auth
pub fn auth(&self) -> &Auth
Get a reference to the auth client for user management and authentication
Sourcepub fn from(&self, table: &str) -> PostgrestClient
pub fn from(&self, table: &str) -> PostgrestClient
Sourcepub fn storage(&self) -> StorageClient
pub fn storage(&self) -> StorageClient
Create a client for the Storage API
Sourcepub fn realtime(&self) -> RealtimeClient
pub fn realtime(&self) -> RealtimeClient
Create a client for the Realtime API
Sourcepub fn functions(&self) -> FunctionsClient
pub fn functions(&self) -> FunctionsClient
Create a client for the Edge Functions API
Sourcepub fn rpc(&self, function_name: &str, params: Value) -> PostgrestClient
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 callparams
- 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}));
Sourcepub fn filter(self, _filter: DatabaseFilter) -> Self
pub fn filter(self, _filter: DatabaseFilter) -> Self
フィルター条件を追加するメソッド
Sourcepub fn in_values<T: Into<Value>>(self, column: &str, values: Vec<T>) -> Self
pub fn in_values<T: Into<Value>>(self, column: &str, values: Vec<T>) -> Self
in演算子による簡便なフィルター追加メソッド(配列の中に含まれるか)
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