File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ def __init__(
7474 self .auth_url = f"{ supabase_url } /auth/v1"
7575 self .storage_url = f"{ supabase_url } /storage/v1"
7676 self .functions_url = f"{ supabase_url } /functions/v1"
77- self .schema = options .schema
7877
7978 # Instantiate clients.
8079 self .auth = self ._init_supabase_auth_client (
@@ -110,6 +109,19 @@ def table(self, table_name: str) -> AsyncRequestBuilder:
110109 """
111110 return self .from_ (table_name )
112111
112+ def schema (self , schema : str ) -> AsyncPostgrestClient :
113+ """Select a schema to query or perform an function (rpc) call.
114+
115+ The schema needs to be on the list of exposed schemas inside Supabase.
116+ """
117+ self ._postgrest = self ._init_postgrest_client (
118+ rest_url = self .rest_url ,
119+ headers = self .options .headers ,
120+ schema = schema ,
121+ timeout = self .options .postgrest_client_timeout ,
122+ )
123+ return self ._postgrest
124+
113125 def from_ (self , table_name : str ) -> AsyncRequestBuilder :
114126 """Perform a table operation.
115127
Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ def __init__(
7474 self .auth_url = f"{ supabase_url } /auth/v1"
7575 self .storage_url = f"{ supabase_url } /storage/v1"
7676 self .functions_url = f"{ supabase_url } /functions/v1"
77- self .schema = options .schema
7877
7978 # Instantiate clients.
8079 self .auth = self ._init_supabase_auth_client (
@@ -110,6 +109,19 @@ def table(self, table_name: str) -> SyncRequestBuilder:
110109 """
111110 return self .from_ (table_name )
112111
112+ def schema (self , schema : str ) -> SyncPostgrestClient :
113+ """Select a schema to query or perform an function (rpc) call.
114+
115+ The schema needs to be on the list of exposed schemas inside Supabase.
116+ """
117+ self ._postgrest = self ._init_postgrest_client (
118+ rest_url = self .rest_url ,
119+ headers = self .options .headers ,
120+ schema = schema ,
121+ timeout = self .options .postgrest_client_timeout ,
122+ )
123+ return self ._postgrest
124+
113125 def from_ (self , table_name : str ) -> SyncRequestBuilder :
114126 """Perform a table operation.
115127
You can’t perform that action at this time.
0 commit comments