44from gotrue import SyncMemoryStorage , SyncSupportedStorage
55from httpx import Timeout
66from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
7+ from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
78
89from supabase import __version__
910
@@ -36,9 +37,14 @@ class ClientOptions:
3637 fetch : Optional [Callable ] = None
3738 """A custom `fetch` implementation."""
3839
39- timeout : Union [int , float , Timeout ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT
40+ postgrest_client_timeout : Union [
41+ int , float , Timeout
42+ ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT
4043 """Timeout passed to the SyncPostgrestClient instance."""
4144
45+ storage_client_timeout : Union [int , float , Timeout ] = DEFAULT_STORAGE_CLIENT_TIMEOUT
46+ """Timeout passed to the SyncStorageClient instance"""
47+
4248 def replace (
4349 self ,
4450 schema : Optional [str ] = None ,
@@ -48,7 +54,12 @@ def replace(
4854 storage : Optional [SyncSupportedStorage ] = None ,
4955 realtime : Optional [Dict [str , Any ]] = None ,
5056 fetch : Optional [Callable ] = None ,
51- timeout : Union [int , float , Timeout ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT ,
57+ postgrest_client_timeout : Union [
58+ int , float , Timeout
59+ ] = DEFAULT_POSTGREST_CLIENT_TIMEOUT ,
60+ storage_client_timeout : Union [
61+ int , float , Timeout
62+ ] = DEFAULT_STORAGE_CLIENT_TIMEOUT ,
5263 ) -> "ClientOptions" :
5364 """Create a new SupabaseClientOptions with changes"""
5465 client_options = ClientOptions ()
@@ -61,5 +72,10 @@ def replace(
6172 client_options .storage = storage or self .storage
6273 client_options .realtime = realtime or self .realtime
6374 client_options .fetch = fetch or self .fetch
64- client_options .timeout = timeout or self .timeout
75+ client_options .postgrest_client_timeout = (
76+ postgrest_client_timeout or self .postgrest_client_timeout
77+ )
78+ client_options .storage_client_timeout = (
79+ storage_client_timeout or self .storage_client_timeout
80+ )
6581 return client_options
0 commit comments