Skip to content

Commit f4ed2af

Browse files
zernoniasoedirgo
authored andcommitted
fix: rpc count is missing
1 parent 374f361 commit f4ed2af

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/SupabaseClient.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,16 @@ export default class SupabaseClient {
9595
*
9696
* @param fn The function name to call.
9797
* @param params The parameters to pass to the function call.
98+
* @param count Count algorithm to use to count rows in a table.
99+
*
98100
*/
99-
rpc<T = any>(fn: string, params?: object) {
101+
rpc<T = any>(
102+
fn: string,
103+
params?: object,
104+
{ count = null }: { count?: null | 'exact' | 'planned' | 'estimated' } = {}
105+
) {
100106
const rest = this._initPostgRESTClient()
101-
return rest.rpc<T>(fn, params)
107+
return rest.rpc<T>(fn, params, { count })
102108
}
103109

104110
/**

0 commit comments

Comments
 (0)