This repository was archived by the owner on Oct 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1
1
import PostgrestQueryBuilder from './lib/PostgrestQueryBuilder'
2
2
import PostgrestRpcBuilder from './lib/PostgrestRpcBuilder'
3
- import PostgrestTransformBuilder from './lib/PostgrestTransformBuilder '
3
+ import PostgrestFilterBuilder from './lib/PostgrestFilterBuilder '
4
4
5
5
export default class PostgrestClient {
6
6
url : string
@@ -58,7 +58,7 @@ export default class PostgrestClient {
58
58
} : {
59
59
count ?: null | 'exact' | 'planned' | 'estimated'
60
60
} = { }
61
- ) : PostgrestTransformBuilder < T > {
61
+ ) : PostgrestFilterBuilder < T > {
62
62
const url = `${ this . url } /rpc/${ fn } `
63
63
return new PostgrestRpcBuilder < T > ( url , {
64
64
headers : this . headers ,
Original file line number Diff line number Diff line change 1
1
import { PostgrestBuilder } from './types'
2
- import PostgrestTransformBuilder from './PostgrestTransformBuilder '
2
+ import PostgrestFilterBuilder from './PostgrestFilterBuilder '
3
3
4
4
export default class PostgrestRpcBuilder < T > extends PostgrestBuilder < T > {
5
5
constructor (
@@ -22,7 +22,7 @@ export default class PostgrestRpcBuilder<T> extends PostgrestBuilder<T> {
22
22
} : {
23
23
count ?: null | 'exact' | 'planned' | 'estimated'
24
24
} = { }
25
- ) : PostgrestTransformBuilder < T > {
25
+ ) : PostgrestFilterBuilder < T > {
26
26
this . method = 'POST'
27
27
this . body = params
28
28
@@ -31,6 +31,6 @@ export default class PostgrestRpcBuilder<T> extends PostgrestBuilder<T> {
31
31
else this . headers [ 'Prefer' ] = `count=${ count } `
32
32
}
33
33
34
- return new PostgrestTransformBuilder ( this )
34
+ return new PostgrestFilterBuilder ( this )
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -743,3 +743,19 @@ test('match', async () => {
743
743
}
744
744
` )
745
745
} )
746
+
747
+ test ( 'filter on stored procedure' , async ( ) => {
748
+ const res = await postgrest
749
+ . rpc ( 'get_username_and_status' , { name_param : 'supabot' } )
750
+ . neq ( 'status' , 'ONLINE' )
751
+ expect ( res ) . toMatchInlineSnapshot ( `
752
+ Object {
753
+ "body": Array [],
754
+ "count": null,
755
+ "data": Array [],
756
+ "error": null,
757
+ "status": 200,
758
+ "statusText": "OK",
759
+ }
760
+ ` )
761
+ } )
You can’t perform that action at this time.
0 commit comments