11
11
AsyncRPCFilterRequestBuilder ,
12
12
)
13
13
from postgrest .constants import DEFAULT_POSTGREST_CLIENT_TIMEOUT
14
+ from postgrest .types import CountMethod
14
15
from realtime import AsyncRealtimeChannel , AsyncRealtimeClient , RealtimeChannelOptions
15
16
from storage3 import AsyncStorageClient
16
17
from storage3 .constants import DEFAULT_TIMEOUT as DEFAULT_STORAGE_CLIENT_TIMEOUT
@@ -139,7 +140,12 @@ def from_(self, table_name: str) -> AsyncRequestBuilder:
139
140
return self .postgrest .from_ (table_name )
140
141
141
142
def rpc (
142
- self , fn : str , params : Optional [Dict [Any , Any ]] = None
143
+ self ,
144
+ fn : str ,
145
+ params : Optional [Dict [Any , Any ]] = None ,
146
+ count : Optional [CountMethod ] = None ,
147
+ head : bool = False ,
148
+ get : bool = False ,
143
149
) -> AsyncRPCFilterRequestBuilder :
144
150
"""Performs a stored procedure call.
145
151
@@ -149,6 +155,9 @@ def rpc(
149
155
The stored procedure call to be executed.
150
156
params : dict of any
151
157
Parameters passed into the stored procedure call.
158
+ count: The method to use to get the count of rows returned.
159
+ head: When set to `true`, `data` will not be returned. Useful if you only need the count.
160
+ get: When set to `true`, the function will be called with read-only access mode.
152
161
153
162
Returns
154
163
-------
@@ -158,7 +167,7 @@ def rpc(
158
167
"""
159
168
if params is None :
160
169
params = {}
161
- return self .postgrest .rpc (fn , params )
170
+ return self .postgrest .rpc (fn , params , count , head , get )
162
171
163
172
@property
164
173
def postgrest (self ):
0 commit comments