diff options
Diffstat (limited to 'lib/sqlalchemy/engine/reflection.py')
-rw-r--r-- | lib/sqlalchemy/engine/reflection.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index 113aa8ea0..d8c2bcbd7 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -268,8 +268,7 @@ class Inspector(object): ) def has_table(self, table_name, schema=None): - """Return True if the backend has a table of the given name. - + """Return True if the backend has a table or view of the given name. :param table_name: name of the table to check :param schema: schema name to query, if not the default schema. @@ -277,6 +276,11 @@ class Inspector(object): .. versionadded:: 1.4 - the :meth:`.Inspector.has_table` method replaces the :meth:`_engine.Engine.has_table` method. + .. versionchanged:: 2.0:: The method checks also for views. + In previous version this behaviour was dialect specific. New + dialect suite tests were added to ensure all dialect conform with + this behaviour. + """ # TODO: info_cache? with self._operation_context() as conn: |