Skip to content

Add suport for listing all available tables #3369

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

Open
Rednas83 opened this issue Mar 28, 2025 · 2 comments
Open

Add suport for listing all available tables #3369

Rednas83 opened this issue Mar 28, 2025 · 2 comments

Comments

@Rednas83
Copy link

Is your feature request related to a problem? Please describe.
Client is unaware of the available tables that can be accessed.

Describe the solution you'd like
const { data: tables } = await supabase.from() // Returns ["projects", etc]

Describe alternatives you've considered
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';

Additional context
https://github.com/orgs/supabase/discussions/33945#discussioncomment-12368707

@silentworks
Copy link
Contributor

I don't think this is the correct repo for this to be opened on. Also what is stopping you from calling the SQL you listed above? this sort of thing should never be a part of the public API of the Supabase SDK as this would be providing potential attackers with an avenue to know and test each of your tables to see if RLS is enabled.

@Rednas83
Copy link
Author

The sql query feels a bit like a hack and I also doubt wheter it wil work as expected because I am only interested in the table names that the authenticated user has acces too in order to be able to populate the correct navigation

I agree that only authenticated users should be able to acces the names of the tables.

Perhaps put it behind a flag?

Something like
discovery of tables = true

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

2 participants