Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use explicit return type for from/schema/rpc #975

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 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) {
from(relation: string): ReturnType<PostgrestClient<Database, SchemaName>['from']> {
return this.rest.from(relation)
}

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

Expand Down Expand Up @@ -174,7 +176,7 @@ export default class SupabaseClient<
head?: boolean
count?: 'exact' | 'planned' | 'estimated'
}
) {
): ReturnType<PostgrestClient<Database, SchemaName>['rpc']> {
return this.rest.rpc(fn, args, options)
}

Expand Down