django-sql-explorer
django-sql-explorer copied to clipboard
schema browser and schema in playground page
[Dear] support, I have a connection to postgresql DB with different schemas and not just the public.
When I go in playground page and press on "show schema" I see only tables within schema public. How I can see tables of other schemas? Is there a specific parameter that I have to set in setting.py?
Thank you in advance. Giuseppe P.
Hi, is there a solution? Did someone solve the problem?
Thank you in advance. Giuseppe P.
@procino What permissions over the database does the user which makes the connection from django have? Is it a user with access to what you want to see in explorer?
Perhaps it'd be worth looking at the settings docs, specifically EXPLORER_DEFAULT_CONNECTION
and EXPLORER_CONNECTIONS
@marksweb This calls the default introspection code in Django so I imagine is related to db connection setup. I feel like we can close this for now.
def table_names(self, cursor=None, include_views=False):
"""
Return a list of names of all tables that exist in the database.
Sort the returned table list by Python's default sorting. Do NOT use
the database's ORDER BY here to avoid subtle differences in sorting
order between databases.
"""
def get_names(cursor):
return sorted(ti.name for ti in self.get_table_list(cursor)
if include_views or ti.type == 't')
if cursor is None:
with self.connection.cursor() as cursor:
return get_names(cursor)
return get_names(cursor)