"supabase gen" should turn timestamptz into a date type
jens-f opened this issue · 2 comments
jens-f commented
When turning this table:
CREATE TABLE IF NOT EXISTS profiles (
id uuid REFERENCES auth.users NOT NULL primary key,
full_name text,
updated_at timestamp with time zone
);
into a typescript definition using:
supabase gen types typescript --local
then the generated type for updated_at looks like this:
updated_at?: string | null;
My expectation would be that timestamptz should rather be represented by
updated_at?: Date | null;
Would it be possible to extend the generator functionality to let the user decide how timestamptz (and possibly other types) are represented in the generated typescript definition?
There's a related issue in the supabase-js repo but the CLI repo is probably the correct one for it.
sweatybridge commented
Moving this to postgres-meta repo which handles type generation.
soedirgo commented
Closing in favor of supabase/postgrest-js#572