supabase / postgres-meta

A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries
https://supabase.com
Apache License 2.0
941 stars 126 forks source link

fix(typegen): use base/composite/enum type for fn columns #624

Closed gulfaraz closed 1 year ago

gulfaraz commented 1 year ago

What kind of change does this PR introduce?

This PR changes gen:types:typescript to generate types for function columns instead of unknown.

What is the current behavior?

The current output is,

// todos
Row: {
    details: string | null
    id: number
    "user-id": number
    blurb: string | null
    blurb_varchar: unknown | null
    details_is_long: unknown | null
    details_length: unknown | null
}

What is the new behavior?

// todos
Row: {
    details: string | null
    id: number
    "user-id": number
    blurb: string | null
    blurb_varchar: string | null
    details_is_long: boolean | null
    details_length: number | null
}
soedirgo commented 1 year ago

Thanks for the PR @gulfaraz!