2
Native TypeScript Enums
Source: supabase/supabase#28179 · opened by @axelrindle
While TypeScript codegen is working fine, I'd like to suggest the usage of [Native TypeScript Enums]( This would allow users to use the Enum for validation purposes, e.g. using zod.
An example:
Then I could do the following with zod:
`ts
import { Meal } from '@/db'
const formSchema = z.object({
meal: z.nativeEnum(Meal)
})
An example:
Then I could do the following with zod:
`ts
import { Meal } from '@/db'
const formSchema = z.object({
meal: z.nativeEnum(Meal)
})
No pledges yet. Be the first to back this.
Comments
Similar requests
Extension to the current "Copy as Markdown" function
1 vote · 0 comments
Add schema-aware Functions, Args, and Returns helper types to generated Supabase TypeScript types
1 vote · 0 comments
Generated TypeScript Types - Add type safe to Tables
2 votes · 0 comments
access to enum unions in db.types.ts (CLI: supabase gen types typescript)
8 votes · 0 comments
Improved type inference for JSONB columns with check constraints in supabase typescript client
3 votes · 0 comments
No comments yet.