-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Function returns set-of view fails introspection if view does not define primary key #481
Comments
Since we don't have a reproduction case, could you please send your project_ref so I can investigate it? Its most likely the issue solved by this PR |
Interesting. I see that PR was already merged. How could I make use of it to solve my case? |
Okay this is a related but different case than PR. You've got 2 functions I think the outcome you're looking for is to be able to query the two views. To do that you can add a comment directive primary key to make them show up in the GraphQL API comment on view "or...ers" is e'@graphql({"primary_key_columns": ["col1", "col2"]})';
comment on view "us....ture" is e'@graphql({"primary_key_columns": ["col1", "col2"]})'; and then you won't need the More info here https://supabase.github.io/pg_graphql/views/ If that assumption was wrong, and you want to exclude the 2 revoke execute on function get_orgusers from anon, public;
revoke execute on function get_user_access_structure from anon, public; and your schema will load, but you won't be able to query those functions |
renaming this issue for tracking |
TODO: update this logic Lines 1290 to 1299 in 2bb35d5
to make sure they table/view will be in the schema. The logic should be the same as in __Schema Lines 3955 to 3959 in 2bb35d5
its a small/simple change |
Interesting.
In the side notes...I hope this has helped supabase to get better :) |
If you change the permissions (option 2) you would be able to call the functions using a direct database connection but not over the API as an anonymous or authenticated user. if you set the comment directive (option 1) you will be able to access the functions over the API and via direct connection |
it did! thanks for reporting |
Describe the bug
I reported this possible bug in the main supabase repository, but I believe it could be linked here.
supabase/supabase#20106
The text was updated successfully, but these errors were encountered: