wipe out old repo & replace with template
This commit is contained in:
26
src/utils/supabase/utils.ts
Normal file
26
src/utils/supabase/utils.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import type { Database } from '@/utils/supabase/types';
|
||||
export type { User } from '@supabase/supabase-js';
|
||||
|
||||
// Table row types
|
||||
export type Profile = Database['public']['Tables']['profiles']['Row'];
|
||||
export type Status = Database['public']['Tables']['statuses']['Row'];
|
||||
|
||||
// Insert types
|
||||
export type ProfileInsert = Database['public']['Tables']['profiles']['Insert'];
|
||||
export type StatusInsert = Database['public']['Tables']['statuses']['Insert'];
|
||||
|
||||
// Update types
|
||||
export type ProfileUpdate = Database['public']['Tables']['profiles']['Update'];
|
||||
export type StatusUpdate = Database['public']['Tables']['statuses']['Update'];
|
||||
|
||||
// Generic helper to get any table's row type
|
||||
export type TableRow<T extends keyof Database['public']['Tables']> =
|
||||
Database['public']['Tables'][T]['Row'];
|
||||
|
||||
// Generic helper to get any table's insert type
|
||||
export type TableInsert<T extends keyof Database['public']['Tables']> =
|
||||
Database['public']['Tables'][T]['Insert'];
|
||||
|
||||
// Generic helper to get any table's update type
|
||||
export type TableUpdate<T extends keyof Database['public']['Tables']> =
|
||||
Database['public']['Tables'][T]['Update'];
|
Reference in New Issue
Block a user