|
4 | 4 | PostgrestClient, |
5 | 5 | type PostgrestFilterBuilder, |
6 | 6 | type PostgrestQueryBuilder, |
| 7 | + type PostgrestQueryBuilderOptions, |
7 | 8 | } from '@supabase/postgrest-js' |
8 | 9 | import { |
9 | 10 | type RealtimeChannel, |
@@ -187,18 +188,25 @@ export default class SupabaseClient< |
187 | 188 | // NOTE: signatures must be kept in sync with PostgrestClient.from |
188 | 189 | from< |
189 | 190 | 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> |
192 | 196 | from<ViewName extends string & keyof Schema['Views'], View extends Schema['Views'][ViewName]>( |
193 | | - relation: ViewName |
| 197 | + relation: ViewName, |
| 198 | + options?: PostgrestQueryBuilderOptions |
194 | 199 | ): PostgrestQueryBuilder<ClientOptions, Schema, View, ViewName> |
195 | 200 | /** |
196 | 201 | * Perform a query on a table or a view. |
197 | 202 | * |
198 | 203 | * @param relation - The table or view name to query |
199 | 204 | */ |
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) |
202 | 210 | } |
203 | 211 |
|
204 | 212 | // NOTE: signatures must be kept in sync with PostgrestClient.schema |
|
0 commit comments