Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jens-f opened this issue Nov 4, 2024 · 2 comments
Closed

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

jens-f opened this issue Nov 4, 2024 · 2 comments

Comments

@jens-f
Copy link

jens-f commented Nov 4, 2024

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 sweatybridge transferred this issue from supabase/cli Nov 5, 2024
@sweatybridge
Copy link
Contributor

Moving this to postgres-meta repo which handles type generation.

@soedirgo
Copy link
Member

soedirgo commented Nov 5, 2024

Closing in favor of supabase/postgrest-js#572

@soedirgo soedirgo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants