File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -129,13 +129,11 @@ def schema(self, schema: str) -> AsyncPostgrestClient:
129
129
130
130
The schema needs to be on the list of exposed schemas inside Supabase.
131
131
"""
132
- self ._postgrest = self ._init_postgrest_client (
133
- rest_url = self .rest_url ,
134
- headers = self .options .headers ,
135
- schema = schema ,
136
- timeout = self .options .postgrest_client_timeout ,
137
- )
138
- return self ._postgrest
132
+ if self .options .schema != schema :
133
+ self .options .schema = schema
134
+ if self ._postgrest :
135
+ self ._postgrest .schema (schema )
136
+ return self .postgrest
139
137
140
138
def from_ (self , table_name : str ) -> AsyncRequestBuilder :
141
139
"""Perform a table operation.
Original file line number Diff line number Diff line change @@ -128,13 +128,11 @@ def schema(self, schema: str) -> SyncPostgrestClient:
128
128
129
129
The schema needs to be on the list of exposed schemas inside Supabase.
130
130
"""
131
- self ._postgrest = self ._init_postgrest_client (
132
- rest_url = self .rest_url ,
133
- headers = self .options .headers ,
134
- schema = schema ,
135
- timeout = self .options .postgrest_client_timeout ,
136
- )
137
- return self ._postgrest
131
+ if self .options .schema != schema :
132
+ self .options .schema = schema
133
+ if self ._postgrest :
134
+ self ._postgrest .schema (schema )
135
+ return self .postgrest
138
136
139
137
def from_ (self , table_name : str ) -> SyncRequestBuilder :
140
138
"""Perform a table operation.
You can’t perform that action at this time.
0 commit comments