list all auth.users

is it possible to list all auth.users meta_data without creating public.users as to not have redundant table that serves no real purpose?
5 Replies
garyaustin
garyaustin3y ago
You would need to write a "security definer" function and call thru rpc if you want to do it from API. You might want to check in the function for user role otherwise anyone can get your list. You also might be able to use a view.
((()))
((()))OP3y ago
from what I understood is that I need to write a function that runs
select raw_user_meta_data from auth.users
select raw_user_meta_data from auth.users
and then call it via rpc? also what do you mean by "use a view"?
garyaustin
garyaustin3y ago
https://supabase.com/docs/guides/database/tables#views You would need to return setof json probably for your function, so would need to be done in SQL editor versus the function UI.
Tables and Data | Supabase
Creating and using Postgres tables.
silentworks
silentworks3y ago
Please do a google search on postgres functions and postgres views to see what a view is.

Did you find this page helpful?