44 PostgrestClient ,
55 PostgrestFilterBuilder ,
66 PostgrestQueryBuilder ,
7- ClientServerOptions as PostgrestClientServerOption ,
8- GetGenericDatabaseWithOptions ,
97} from '@supabase/postgrest-js'
108import {
119 RealtimeChannel ,
@@ -30,18 +28,13 @@ import { Fetch, GenericSchema, SupabaseClientOptions, SupabaseAuthClientOptions
3028 *
3129 * An isomorphic Javascript client for interacting with Postgres.
3230 */
33-
34- export type ServicesOptions = PostgrestClientServerOption & { }
35-
3631export default class SupabaseClient <
3732 Database = any ,
38- ClientOptions extends ServicesOptions = { PostgrestVersion : '12' } ,
39- SchemaName extends string &
40- keyof GetGenericDatabaseWithOptions < Database > [ 'db' ] = 'public' extends keyof GetGenericDatabaseWithOptions < Database > [ 'db' ]
33+ SchemaName extends string & keyof Database = 'public' extends keyof Database
4134 ? 'public'
42- : string & keyof GetGenericDatabaseWithOptions < Database > [ 'db' ] ,
43- Schema extends GenericSchema = GetGenericDatabaseWithOptions < Database > [ 'db' ] [ SchemaName ] extends GenericSchema
44- ? GetGenericDatabaseWithOptions < Database > [ 'db' ] [ SchemaName ]
35+ : string & keyof Database ,
36+ Schema extends GenericSchema = Database [ SchemaName ] extends GenericSchema
37+ ? Database [ SchemaName ]
4538 : any
4639> {
4740 /**
@@ -54,7 +47,7 @@ export default class SupabaseClient<
5447 protected authUrl : URL
5548 protected storageUrl : URL
5649 protected functionsUrl : URL
57- protected rest : PostgrestClient < Database , ClientOptions , SchemaName , Schema >
50+ protected rest : PostgrestClient < Database , SchemaName , Schema >
5851 protected storageKey : string
5952 protected fetch ?: Fetch
6053 protected changedAccessToken ?: string
@@ -163,16 +156,16 @@ export default class SupabaseClient<
163156 from <
164157 TableName extends string & keyof Schema [ 'Tables' ] ,
165158 Table extends Schema [ 'Tables' ] [ TableName ]
166- > ( relation : TableName ) : PostgrestQueryBuilder < ClientOptions , Schema , Table , TableName >
159+ > ( relation : TableName ) : PostgrestQueryBuilder < Schema , Table , TableName >
167160 from < ViewName extends string & keyof Schema [ 'Views' ] , View extends Schema [ 'Views' ] [ ViewName ] > (
168161 relation : ViewName
169- ) : PostgrestQueryBuilder < ClientOptions , Schema , View , ViewName >
162+ ) : PostgrestQueryBuilder < Schema , View , ViewName >
170163 /**
171164 * Perform a query on a table or a view.
172165 *
173166 * @param relation - The table or view name to query
174167 */
175- from ( relation : string ) : PostgrestQueryBuilder < ClientOptions , Schema , any , any > {
168+ from ( relation : string ) : PostgrestQueryBuilder < Schema , any , any > {
176169 return this . rest . from ( relation )
177170 }
178171
@@ -184,11 +177,10 @@ export default class SupabaseClient<
184177 *
185178 * @param schema - The schema to query
186179 */
187- schema < DynamicSchema extends string & keyof GetGenericDatabaseWithOptions < Database > [ 'db' ] > (
180+ schema < DynamicSchema extends string & keyof Database > (
188181 schema : DynamicSchema
189182 ) : PostgrestClient <
190183 Database ,
191- ClientOptions ,
192184 DynamicSchema ,
193185 Database [ DynamicSchema ] extends GenericSchema ? Database [ DynamicSchema ] : any
194186 > {
@@ -228,7 +220,6 @@ export default class SupabaseClient<
228220 count ?: 'exact' | 'planned' | 'estimated'
229221 } = { }
230222 ) : PostgrestFilterBuilder <
231- ClientOptions ,
232223 Schema ,
233224 Fn [ 'Returns' ] extends any [ ]
234225 ? Fn [ 'Returns' ] [ number ] extends Record < string , unknown >
@@ -237,8 +228,7 @@ export default class SupabaseClient<
237228 : never ,
238229 Fn [ 'Returns' ] ,
239230 FnName ,
240- null ,
241- 'RPC'
231+ null
242232 > {
243233 return this . rest . rpc ( fn , args , options )
244234 }
0 commit comments