1
1
import asyncio
2
2
import re
3
- from typing import Any, Dict, List, Optional, Union
3
+ from typing import Any, Dict, Optional, Union
4
4
5
5
from gotrue import AsyncMemoryStorage
6
6
from gotrue.types import AuthChangeEvent, Session
7
7
from httpx import Timeout
8
8
from postgrest import (
9
9
AsyncPostgrestClient,
10
- AsyncRequestBuilder,
11
- AsyncRPCFilterRequestBuilder,
12
10
)
13
11
from postgrest.constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
14
12
from postgrest.types import CountMethod
@@ -116,7 +114,7 @@ async def create(
116
114
117
115
return client
118
116
119
- def table(self, table_name: str) -> AsyncRequestBuilder :
117
+ def table(self, table_name: str):
120
118
"""Perform a table operation.
121
119
122
120
Note that the supabase client uses the `from` method, but in Python,
@@ -125,14 +123,14 @@ def table(self, table_name: str) -> AsyncRequestBuilder:
125
123
"""
126
124
return self.from_(table_name)
127
125
128
- def schema(self, schema: str) -> AsyncPostgrestClient :
126
+ def schema(self, schema: str):
129
127
"""Select a schema to query or perform an function (rpc) call.
130
128
131
129
The schema needs to be on the list of exposed schemas inside Supabase.
132
130
"""
133
131
return self.postgrest.schema(schema)
134
132
135
- def from_(self, table_name: str) -> AsyncRequestBuilder :
133
+ def from_(self, table_name: str):
136
134
"""Perform a table operation.
137
135
138
136
See the `table` method.
@@ -146,7 +144,7 @@ def rpc(
146
144
count: Optional[CountMethod] = None,
147
145
head: bool = False,
148
146
get: bool = False,
149
- ) -> AsyncRPCFilterRequestBuilder :
147
+ ):
150
148
"""Performs a stored procedure call.
151
149
152
150
Parameters
@@ -161,7 +159,7 @@ def rpc(
161
159
162
160
Returns
163
161
-------
164
- SyncFilterRequestBuilder
162
+ AsyncFilterRequestBuilder
165
163
Returns a filter builder. This lets you apply filters on the response
166
164
of an RPC.
167
165
"""
@@ -207,15 +205,15 @@ def channel(
207
205
"""Creates a Realtime channel with Broadcast, Presence, and Postgres Changes."""
208
206
return self.realtime.channel(topic, params)
209
207
210
- def get_channels(self) -> List[AsyncRealtimeChannel] :
208
+ def get_channels(self):
211
209
"""Returns all realtime channels."""
212
210
return self.realtime.get_channels()
213
211
214
- async def remove_channel(self, channel: AsyncRealtimeChannel) -> None :
212
+ async def remove_channel(self, channel: AsyncRealtimeChannel):
215
213
"""Unsubscribes and removes Realtime channel from Realtime client."""
216
214
await self.realtime.remove_channel(channel)
217
215
218
- async def remove_all_channels(self) -> None :
216
+ async def remove_all_channels(self):
219
217
"""Unsubscribes and removes all Realtime channels from Realtime client."""
220
218
await self.realtime.remove_all_channels()
221
219
0 commit comments