Skip to content

Commit

Permalink
fix: revert from/schema/rpc changes
Browse files Browse the repository at this point in the history
This reverts commit a5a70db.
  • Loading branch information
soedirgo committed Feb 14, 2024
1 parent b9cb9e1 commit 76c93a3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/SupabaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default class SupabaseClient<
*
* @param relation - The table or view name to query
*/
from(relation: string): ReturnType<PostgrestClient<Database, SchemaName>['from']> {
from: PostgrestClient<Database, SchemaName>['from'] = (relation: string) => {
return this.rest.from(relation)
}

Expand All @@ -142,9 +142,11 @@ export default class SupabaseClient<
*
* @param schema - The name of the schema to query
*/
schema<DynamicSchema extends string & keyof Database>(
schema: PostgrestClient<Database, SchemaName>['schema'] = <
DynamicSchema extends string & keyof Database
>(
schema: DynamicSchema
): ReturnType<PostgrestClient<Database, SchemaName>['schema']> {
) => {
return this.rest.schema<DynamicSchema>(schema)
}

Expand All @@ -169,14 +171,17 @@ export default class SupabaseClient<
* `"estimated"`: Uses exact count for low numbers and planned count for high
* numbers.
*/
rpc<FnName extends string & keyof Schema['Functions'], Fn extends Schema['Functions'][FnName]>(
fn: FnName,
args: Fn['Args'] = {},
rpc: PostgrestClient<Database, SchemaName>['rpc'] = <
FunctionName extends string & keyof Schema['Functions'],
Function_ extends Schema['Functions'][FunctionName]
>(
fn: FunctionName,
args: Function_['Args'] = {},
options?: {
head?: boolean
count?: 'exact' | 'planned' | 'estimated'
}
): ReturnType<PostgrestClient<Database, SchemaName>['rpc']> {
) => {
return this.rest.rpc(fn, args, options)
}

Expand Down

0 comments on commit 76c93a3

Please sign in to comment.