Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
2 replies
Vimes

Zod with types from Supabase type gen

Trying to use types from supabase typegen with Zod, but I can't figure out how. They supabase docs use this weird syntax for getting the data.

My current attempt
type TaaS = Database['public']['Tables']['taas']['Row']

const Props = z.object({
  user: User,
  profile: Profile,
  audits: Audit,
  taas: z.array(TaaS), <- This fails
});

Any ideas on how I can fix this 🤔
Was this page helpful?