Skip to content

Commit ddc8b9d

Browse files
stenlanmandarini
authored andcommitted
Update SupabaseClient#from function signatures to match PostgrestClient#from
1 parent d70d3e0 commit ddc8b9d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

packages/core/supabase-js/src/SupabaseClient.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
PostgrestClient,
55
type PostgrestFilterBuilder,
66
type PostgrestQueryBuilder,
7+
type PostgrestQueryBuilderOptions,
78
} from '@supabase/postgrest-js'
89
import {
910
type RealtimeChannel,
@@ -187,18 +188,25 @@ export default class SupabaseClient<
187188
// NOTE: signatures must be kept in sync with PostgrestClient.from
188189
from<
189190
TableName extends string & keyof Schema['Tables'],
190-
Table extends Schema['Tables'][TableName],
191-
>(relation: TableName): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>
191+
Table extends Schema['Tables'][TableName]
192+
>(
193+
relation: TableName,
194+
options?: PostgrestQueryBuilderOptions
195+
): PostgrestQueryBuilder<ClientOptions, Schema, Table, TableName>
192196
from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>(
193-
relation: ViewName
197+
relation: ViewName,
198+
options?: PostgrestQueryBuilderOptions
194199
): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName>
195200
/**
196201
* Perform a query on a table or a view.
197202
*
198203
* @param relation - The table or view name to query
199204
*/
200-
from(relation: string): PostgrestQueryBuilder<ClientOptions, Schema, any> {
201-
return this.rest.from(relation)
205+
from(
206+
relation: string,
207+
options?: PostgrestQueryBuilderOptions
208+
): PostgrestQueryBuilder<ClientOptions, Schema, any> {
209+
return this.rest.from(relation, options)
202210
}
203211

204212
// NOTE: signatures must be kept in sync with PostgrestClient.schema

0 commit comments

Comments
 (0)