Pass kwargs to get_table_names function

When using the `get_table_names` function, the function currently will not allow the user to pass in the `schema` argument. This means that, for instance, you can't get the table names for a PostgreSQL schema other than the default schema. This feature could be added quite easily.
This commit is contained in:
Keelan Fadden-Hopper
2019-02-13 11:50:45 +00:00
committed by GitHub
parent 80ad70f07d
commit 9d1e1b8eed
+2 -2
View File
@@ -276,11 +276,11 @@ class Database(object):
def __repr__(self):
return '<Database open={}>'.format(self.open)
def get_table_names(self, internal=False):
def get_table_names(self, internal=False, **kwargs):
"""Returns a list of table names for the connected database."""
# Setup SQLAlchemy for Database inspection.
return inspect(self._engine).get_table_names()
return inspect(self._engine).get_table_names(**kwargs)
def get_connection(self):
"""Get a connection to this Database. Connections are retrieved from a