pub struct Client { /* private fields */ }
Expand description
A client to interact with the Supabase Management API.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn get_postgres_config(
&self,
project_id: &str,
) -> Result<PostgresConfig, Error>
pub async fn get_postgres_config( &self, project_id: &str, ) -> Result<PostgresConfig, Error>
Get the Postgres configs for a project
pub async fn set_postgres_config( &self, project_id: &str, config: &PostgresConfig, ) -> Result<PostgresConfig, Error>
Source§impl Client
impl Client
Sourcepub async fn list_projects(&self) -> Result<Vec<Project>, Error>
pub async fn list_projects(&self) -> Result<Vec<Project>, Error>
List all projects this user has created
Sourcepub async fn pause_project(&self, project_id: &str) -> Result<(), Error>
pub async fn pause_project(&self, project_id: &str) -> Result<(), Error>
Pause an active project. Returns 400 if the project is already paused.
Sourcepub async fn restore_project(&self, project_id: &str) -> Result<(), Error>
pub async fn restore_project(&self, project_id: &str) -> Result<(), Error>
Restore a paused/inactive project.
Sourcepub async fn get_project_health(
&self,
project_id: &str,
) -> Result<Vec<ServiceHealth>, Error>
pub async fn get_project_health( &self, project_id: &str, ) -> Result<Vec<ServiceHealth>, Error>
Gets project’s service health status.
Source§impl Client
impl Client
Sourcepub async fn query<T: DeserializeOwned>(
&self,
project_id: &str,
query: &str,
) -> Result<T, Error>
pub async fn query<T: DeserializeOwned>( &self, project_id: &str, query: &str, ) -> Result<T, Error>
[Beta endpoint] Executes a Postgres query using the Supabase Management API.
#[derive(Deserialize, PartialEq, Debug)]
struct Row {
id: i32,
hash_value: String,
}
let rows: Vec<Row> = client
.query(
project_id,
"SELECT generate_series(1, 3) AS id, \
md5(generate_series(1, 3)::text) AS hash_value",
)
.await?;
assert_eq!(
rows,
[
Row {
id: 1,
hash_value: "c4ca4238a0b923820dcc509a6f75849b".into(),
},
Row {
id: 2,
hash_value: "c81e728d9d4c2f636f067f89cc14862c".into(),
},
Row {
id: 3,
hash_value: "eccbc87e4b5ce2fe28308fd9f2a7baf3".into(),
},
]
);
Source§impl Client
impl Client
Sourcepub async fn get_storage_config(
&self,
project_id: &str,
) -> Result<StorageConfig, Error>
pub async fn get_storage_config( &self, project_id: &str, ) -> Result<StorageConfig, Error>
Gets project’s storage config
pub async fn list_buckets(&self, project_id: &str) -> Result<Vec<Bucket>, Error>
Source§impl Client
impl Client
pub async fn get_supavisor_details( &self, project_id: &str, ) -> Result<Vec<SupavisorConfig>, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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