4
4
PostgrestClient ,
5
5
PostgrestFilterBuilder ,
6
6
PostgrestQueryBuilder ,
7
- ClientServerOptions as PostgrestClientServerOption ,
8
- GetGenericDatabaseWithOptions ,
9
7
} from '@supabase/postgrest-js'
10
8
import {
11
9
RealtimeChannel ,
@@ -30,18 +28,13 @@ import { Fetch, GenericSchema, SupabaseClientOptions, SupabaseAuthClientOptions
30
28
*
31
29
* An isomorphic Javascript client for interacting with Postgres.
32
30
*/
33
-
34
- export type ServicesOptions = PostgrestClientServerOption & { }
35
-
36
31
export default class SupabaseClient <
37
32
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
41
34
? '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 ]
45
38
: any
46
39
> {
47
40
/**
@@ -54,7 +47,7 @@ export default class SupabaseClient<
54
47
protected authUrl : URL
55
48
protected storageUrl : URL
56
49
protected functionsUrl : URL
57
- protected rest : PostgrestClient < Database , ClientOptions , SchemaName , Schema >
50
+ protected rest : PostgrestClient < Database , SchemaName , Schema >
58
51
protected storageKey : string
59
52
protected fetch ?: Fetch
60
53
protected changedAccessToken ?: string
@@ -163,16 +156,16 @@ export default class SupabaseClient<
163
156
from <
164
157
TableName extends string & keyof Schema [ 'Tables' ] ,
165
158
Table extends Schema [ 'Tables' ] [ TableName ]
166
- > ( relation : TableName ) : PostgrestQueryBuilder < ClientOptions , Schema , Table , TableName >
159
+ > ( relation : TableName ) : PostgrestQueryBuilder < Schema , Table , TableName >
167
160
from < ViewName extends string & keyof Schema [ 'Views' ] , View extends Schema [ 'Views' ] [ ViewName ] > (
168
161
relation : ViewName
169
- ) : PostgrestQueryBuilder < ClientOptions , Schema , View , ViewName >
162
+ ) : PostgrestQueryBuilder < Schema , View , ViewName >
170
163
/**
171
164
* Perform a query on a table or a view.
172
165
*
173
166
* @param relation - The table or view name to query
174
167
*/
175
- from ( relation : string ) : PostgrestQueryBuilder < ClientOptions , Schema , any , any > {
168
+ from ( relation : string ) : PostgrestQueryBuilder < Schema , any , any > {
176
169
return this . rest . from ( relation )
177
170
}
178
171
@@ -184,11 +177,10 @@ export default class SupabaseClient<
184
177
*
185
178
* @param schema - The schema to query
186
179
*/
187
- schema < DynamicSchema extends string & keyof GetGenericDatabaseWithOptions < Database > [ 'db' ] > (
180
+ schema < DynamicSchema extends string & keyof Database > (
188
181
schema : DynamicSchema
189
182
) : PostgrestClient <
190
183
Database ,
191
- ClientOptions ,
192
184
DynamicSchema ,
193
185
Database [ DynamicSchema ] extends GenericSchema ? Database [ DynamicSchema ] : any
194
186
> {
@@ -228,7 +220,6 @@ export default class SupabaseClient<
228
220
count ?: 'exact' | 'planned' | 'estimated'
229
221
} = { }
230
222
) : PostgrestFilterBuilder <
231
- ClientOptions ,
232
223
Schema ,
233
224
Fn [ 'Returns' ] extends any [ ]
234
225
? Fn [ 'Returns' ] [ number ] extends Record < string , unknown >
@@ -237,8 +228,7 @@ export default class SupabaseClient<
237
228
: never ,
238
229
Fn [ 'Returns' ] ,
239
230
FnName ,
240
- null ,
241
- 'RPC'
231
+ null
242
232
> {
243
233
return this . rest . rpc ( fn , args , options )
244
234
}
0 commit comments