Skip to content

Commit 76c93a3

Browse files
committed
fix: revert from/schema/rpc changes
This reverts commit a5a70db.
1 parent b9cb9e1 commit 76c93a3

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/SupabaseClient.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default class SupabaseClient<
130130
*
131131
* @param relation - The table or view name to query
132132
*/
133-
from(relation: string): ReturnType<PostgrestClient<Database, SchemaName>['from']> {
133+
from: PostgrestClient<Database, SchemaName>['from'] = (relation: string) => {
134134
return this.rest.from(relation)
135135
}
136136

@@ -142,9 +142,11 @@ export default class SupabaseClient<
142142
*
143143
* @param schema - The name of the schema to query
144144
*/
145-
schema<DynamicSchema extends string & keyof Database>(
145+
schema: PostgrestClient<Database, SchemaName>['schema'] = <
146+
DynamicSchema extends string & keyof Database
147+
>(
146148
schema: DynamicSchema
147-
): ReturnType<PostgrestClient<Database, SchemaName>['schema']> {
149+
) => {
148150
return this.rest.schema<DynamicSchema>(schema)
149151
}
150152

@@ -169,14 +171,17 @@ export default class SupabaseClient<
169171
* `"estimated"`: Uses exact count for low numbers and planned count for high
170172
* numbers.
171173
*/
172-
rpc<FnName extends string & keyof Schema['Functions'], Fn extends Schema['Functions'][FnName]>(
173-
fn: FnName,
174-
args: Fn['Args'] = {},
174+
rpc: PostgrestClient<Database, SchemaName>['rpc'] = <
175+
FunctionName extends string & keyof Schema['Functions'],
176+
Function_ extends Schema['Functions'][FunctionName]
177+
>(
178+
fn: FunctionName,
179+
args: Function_['Args'] = {},
175180
options?: {
176181
head?: boolean
177182
count?: 'exact' | 'planned' | 'estimated'
178183
}
179-
): ReturnType<PostgrestClient<Database, SchemaName>['rpc']> {
184+
) => {
180185
return this.rest.rpc(fn, args, options)
181186
}
182187

0 commit comments

Comments
 (0)