postgres-meta
postgres-meta copied to clipboard
Type generation: `unknown` generated for columns of views which are have the row type of a table
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 27128d0525e1c9486c774c5ee89fe3d7c1821281
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.