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

Type generation: unknown generated for columns of views which are have the row type of a table #534

Open
joeally opened this issue Mar 11, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@joeally
Copy link
Contributor

joeally commented Mar 11, 2023

Bug report

Describe the bug

In the situation where we have a view in which one of the columns has the row type of a table, unknown is generated for that column.

I've already created a fix for this in the PR #533

To Reproduce

Create a view in the following form that selects from an existing table of yours.

e.g

CREATE VIEW rows_with_user_view AS (
  SELECT *, users as user FROM rows
  INNER JOIN users on rows.user_id = user.id
);

Run type generation and search for rows_with_user_view

{
...typescript
  public: {
    ...
    Views: {
      rows_with_user_view: {
        Row: {
          ...
          user: unknown
        }
      }
    }
    ...
  }
...
}

Expected behavior

{
...
  public: {
    ...
    Views: {
      rows_with_user_view: {
        Row: {
          ...
          user: Database["public"]["Tables"]["users"]["Row"]
        }
      }
    }
    ...
  }
...
}

System information

  • OS: Mac OS 12.0.1 With supabase/postgres-meta running inside docker 20.10.11
  • Version of supabase/postgres-meta: Commit 27128d0
@joeally joeally added the bug Something isn't working label Mar 11, 2023
@joeally
Copy link
Contributor Author

joeally commented Mar 23, 2023

Is there any chance someone can look at my PR to fix this #533? It's a really short one which should only take a few minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant