jupyterlab-sql
jupyterlab-sql copied to clipboard
Database schemas
As of now, it seems there is no way to view tables unless they are under the default schema, e.g. dbo.table
It would be useful to either as a default show all schemas and the underlying tables, or at least somehow allow the user to select the schema (something that is not possible in the connection string). I guess an implementation should be possible, as the extension builds upon sqlalchemy, where schema can easily be selected when listing table names - engine.table_names(schema=foo)
.
Best regards
Thanks for raising this. What flavour of SQL / database engine are you referring to?
Microsoft SQL, using mssql+pyodbc
to connect with sqlalchemy:
I don't have much experience in programming extensions, but looking at the code, I believe a function in the Class Executer
could return the schemas:
def fetch_schema_names(self, connection_url):
engine = self._get_engine(connection_url)
insp = inspect(engine)
return insp.get_schema_names()
The entire thing about programming the interface and handlers is too big of a mouthful for me at this stage though...
I use postgre and do not using scheme "public" generally. It would be greate view all schemas and tables from data base which I connected.