Skip to content

How do you get the table names of all of the tables within the project? #27603

Discussion options

You must be logged in to vote

You are not going to be able to do this from a REST client directly. You will need an RPC call to a security definer Postgres function to get access to these schemas that should not or cannot be exposed to the API. There also will be privilege issues on them.

There is an open API call than can get you tables. https://postgrest.org/en/v12/references/api/openapi.html

You really should use though cascade deletes on your foreign keys columns to delete all information from tables when the parent table (maybe all the way up to auth.users) row is deleted. Then you don't need to worry about it and it is enforced by your table relationships.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by justinfarrelldev
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants