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 11import PostgrestQueryBuilder from './lib/PostgrestQueryBuilder'
22import PostgrestRpcBuilder from './lib/PostgrestRpcBuilder'
3- import PostgrestTransformBuilder from './lib/PostgrestTransformBuilder '
3+ import PostgrestFilterBuilder from './lib/PostgrestFilterBuilder '
44
55export default class PostgrestClient {
66 url : string
@@ -58,7 +58,7 @@ export default class PostgrestClient {
5858 } : {
5959 count ?: null | 'exact' | 'planned' | 'estimated'
6060 } = { }
61- ) : PostgrestTransformBuilder < T > {
61+ ) : PostgrestFilterBuilder < T > {
6262 const url = `${ this . url } /rpc/${ fn } `
6363 return new PostgrestRpcBuilder < T > ( url , {
6464 headers : this . headers ,
Original file line number Diff line number Diff line change 11import { PostgrestBuilder } from './types'
2- import PostgrestTransformBuilder from './PostgrestTransformBuilder '
2+ import PostgrestFilterBuilder from './PostgrestFilterBuilder '
33
44export default class PostgrestRpcBuilder < T > extends PostgrestBuilder < T > {
55 constructor (
@@ -22,7 +22,7 @@ export default class PostgrestRpcBuilder<T> extends PostgrestBuilder<T> {
2222 } : {
2323 count ?: null | 'exact' | 'planned' | 'estimated'
2424 } = { }
25- ) : PostgrestTransformBuilder < T > {
25+ ) : PostgrestFilterBuilder < T > {
2626 this . method = 'POST'
2727 this . body = params
2828
@@ -31,6 +31,6 @@ export default class PostgrestRpcBuilder<T> extends PostgrestBuilder<T> {
3131 else this . headers [ 'Prefer' ] = `count=${ count } `
3232 }
3333
34- return new PostgrestTransformBuilder ( this )
34+ return new PostgrestFilterBuilder ( this )
3535 }
3636}
Original file line number Diff line number Diff line change @@ -743,3 +743,19 @@ test('match', async () => {
743743 }
744744 ` )
745745} )
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