Skip to content

Commit 4c7f571

Browse files
authored
Merge pull request #1300 from supabase/fix/revert-new-parser
fix: Revert "Merge pull request #1299 from supabase/rc"
2 parents 963d6a5 + 0585c01 commit 4c7f571

File tree

5 files changed

+8
-23
lines changed

5 files changed

+8
-23
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@supabase/auth-js": "2.65.1",
4444
"@supabase/functions-js": "2.4.3",
4545
"@supabase/node-fetch": "2.6.15",
46-
"@supabase/postgrest-js": "1.17.0",
46+
"@supabase/postgrest-js": "1.16.3",
4747
"@supabase/realtime-js": "2.10.7",
4848
"@supabase/storage-js": "2.7.1"
4949
},

src/SupabaseClient.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ export default class SupabaseClient<
221221
? Fn['Returns'][number]
222222
: never
223223
: never,
224-
Fn['Returns'],
225-
FnName,
226-
null
224+
Fn['Returns']
227225
> {
228226
return this.rest.rpc(fn, args, options)
229227
}

src/lib/types.ts

-10
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,16 @@ export type SupabaseClientOptions<SchemaName> = {
8080
accessToken?: () => Promise<string>
8181
}
8282

83-
export type GenericRelationship = {
84-
foreignKeyName: string
85-
columns: string[]
86-
isOneToOne?: boolean
87-
referencedRelation: string
88-
referencedColumns: string[]
89-
}
90-
9183
export type GenericTable = {
9284
Row: Record<string, unknown>
9385
Insert: Record<string, unknown>
9486
Update: Record<string, unknown>
95-
Relationships: GenericRelationship[]
9687
}
9788

9889
export type GenericUpdatableView = GenericTable
9990

10091
export type GenericNonUpdatableView = {
10192
Row: Record<string, unknown>
102-
Relationships: GenericRelationship[]
10393
}
10494

10595
export type GenericView = GenericUpdatableView | GenericNonUpdatableView

test/index.test-d.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const supabase = createClient<Database>(URL, KEY)
8484
if (error) {
8585
throw new Error(error.message)
8686
}
87-
expectType<Database['public']['Tables']['users']['Row']>(message.user)
87+
expectType<Database['public']['Tables']['users']['Row'] | null>(message.user)
8888
}
8989

9090
// one-to-many relationship
@@ -99,11 +99,8 @@ const supabase = createClient<Database>(URL, KEY)
9999
// referencing missing column
100100
{
101101
type SelectQueryError<Message extends string> = { error: true } & Message
102-
103102
const res = await supabase.from('users').select('username, dat')
104-
expectType<
105-
PostgrestSingleResponse<SelectQueryError<"column 'dat' does not exist on 'users'.">[]>
106-
>(res)
103+
expectType<PostgrestSingleResponse<SelectQueryError<`Referencing missing column \`dat\``>[]>>(res)
107104
}
108105

109106
// one-to-one relationship

0 commit comments

Comments
 (0)