Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit 44d847c

Browse files
committed
chore: stored procedure -> function/rpc
1 parent 7123cf8 commit 44d847c

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@supabase/postgrest-js",
3-
"version": "0.0.0",
3+
"version": "0.0.0-automated",
44
"description": "Isomorphic PostgREST client",
55
"keywords": [
66
"postgrest",

src/PostgrestClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default class PostgrestClient {
4444
}
4545

4646
/**
47-
* Perform a stored procedure call.
47+
* Perform a function call.
4848
*
4949
* @param fn The function name to call.
5050
* @param params The parameters to pass to the function call.

src/lib/PostgrestRpcBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class PostgrestRpcBuilder<T> extends PostgrestBuilder<T> {
1313
}
1414

1515
/**
16-
* Perform a stored procedure call.
16+
* Perform a function call.
1717
*/
1818
rpc(
1919
params?: object,

test/__snapshots__/index.test.ts.snap

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,39 @@ Object {
19711971
}
19721972
`;
19731973

1974+
exports[`rpc 1`] = `
1975+
Object {
1976+
"body": "ONLINE",
1977+
"count": null,
1978+
"data": "ONLINE",
1979+
"error": null,
1980+
"status": 200,
1981+
"statusText": "OK",
1982+
}
1983+
`;
1984+
1985+
exports[`rpc returns void 1`] = `
1986+
Object {
1987+
"body": null,
1988+
"count": null,
1989+
"data": null,
1990+
"error": null,
1991+
"status": 200,
1992+
"statusText": "OK",
1993+
}
1994+
`;
1995+
1996+
exports[`rpc with count: 'exact' 1`] = `
1997+
Object {
1998+
"body": "ONLINE",
1999+
"count": 1,
2000+
"data": "ONLINE",
2001+
"error": null,
2002+
"status": 200,
2003+
"statusText": "OK",
2004+
}
2005+
`;
2006+
19742007
exports[`select on insert 1`] = `
19752008
Object {
19762009
"body": Array [
@@ -1990,7 +2023,7 @@ Object {
19902023
}
19912024
`;
19922025

1993-
exports[`select on stored procedure 1`] = `
2026+
exports[`select on rpc 1`] = `
19942027
Object {
19952028
"body": Array [
19962029
Object {
@@ -2168,39 +2201,6 @@ Object {
21682201
}
21692202
`;
21702203
2171-
exports[`stored procedure 1`] = `
2172-
Object {
2173-
"body": "ONLINE",
2174-
"count": null,
2175-
"data": "ONLINE",
2176-
"error": null,
2177-
"status": 200,
2178-
"statusText": "OK",
2179-
}
2180-
`;
2181-
2182-
exports[`stored procedure returns void 1`] = `
2183-
Object {
2184-
"body": null,
2185-
"count": null,
2186-
"data": null,
2187-
"error": null,
2188-
"status": 200,
2189-
"statusText": "OK",
2190-
}
2191-
`;
2192-
2193-
exports[`stored procedure with count: 'exact' 1`] = `
2194-
Object {
2195-
"body": "ONLINE",
2196-
"count": 1,
2197-
"data": "ONLINE",
2198-
"error": null,
2199-
"status": 200,
2200-
"statusText": "OK",
2201-
}
2202-
`;
2203-
22042204
exports[`switch schema 1`] = `
22052205
Object {
22062206
"body": Array [

test/basic.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ test('basic select table', async () => {
88
expect(res).toMatchSnapshot()
99
})
1010

11-
test('stored procedure', async () => {
11+
test('rpc', async () => {
1212
const res = await postgrest.rpc('get_status', { name_param: 'supabot' })
1313
expect(res).toMatchSnapshot()
1414
})
1515

16-
test('stored procedure returns void', async () => {
16+
test('rpc returns void', async () => {
1717
const res = await postgrest.rpc('void_func')
1818
expect(res).toMatchSnapshot()
1919
})
@@ -208,7 +208,7 @@ test('select with count:exact', async () => {
208208
expect(res).toMatchSnapshot()
209209
})
210210

211-
test("stored procedure with count: 'exact'", async () => {
211+
test("rpc with count: 'exact'", async () => {
212212
const res = await postgrest.rpc('get_status', { name_param: 'supabot' }, { count: 'exact' })
213213
expect(res).toMatchSnapshot()
214214
})

test/filters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ test('match', async () => {
749749
`)
750750
})
751751

752-
test('filter on stored procedure', async () => {
752+
test('filter on rpc', async () => {
753753
const res = await postgrest
754754
.rpc('get_username_and_status', { name_param: 'supabot' })
755755
.neq('status', 'ONLINE')

test/transforms.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ test('select on insert', async () => {
5050
await postgrest.from('users').delete().eq('username', 'foo')
5151
})
5252

53-
test('select on stored procedure', async () => {
53+
test('select on rpc', async () => {
5454
const res = await postgrest
5555
.rpc('get_username_and_status', { name_param: 'supabot' })
5656
.select('status')

0 commit comments

Comments
 (0)