Skip to content

"supabase gen" should turn timestamptz into a date type #822

Closed as not planned
@jens-f

Description

@jens-f

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions