You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{Database}from'lib/database.types.ts'constclient=useSupabaseClient<Database>()const{data: book}=awaitclient.from('books')// TypeScript is aware of all the table names..select().eq('id',id).single();const{ title, author, publish_date, created_at, updated_at }=book// TypeScript is aware of all columns for that table.
Describe alternatives you've considered
It seems to work for the composables if I change the "useSupabaseClient" signature to <T>(): SupabaseClient<T> and use the type further down like this:
Describe the solution you'd like
The ability to pass in database types to the Supabase client, as shown in the docs here: https://supabase.com/docs/reference/javascript/typescript-support
Example of how it might be used:
Describe alternatives you've considered
It seems to work for the composables if I change the "useSupabaseClient" signature to
<T>(): SupabaseClient<T>
and use the type further down like this:I'm not sure how to handle setting the types when the "supabase.client.ts" and "supabase.server.ts" plugins load, though.
The text was updated successfully, but these errors were encountered: