]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
The ``has_table`` method now also checks views
authorFederico Caselli <cfederico87@gmail.com>
Sun, 10 Oct 2021 08:41:13 +0000 (10:41 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 31 Oct 2021 16:18:02 +0000 (12:18 -0400)
commitde61582933b800272cc818d36de9e0b7f86aa4fe
treea849fa02e7b989f764072bdb1ff3226d55c6099e
parentcdce33e2ccb60365f12eb07c0b86fdc2b89b5033
The ``has_table`` method now also checks views

The :meth:`_engine.Inspector.has_table` method will now consistently check
for views of the given name as well as tables. Previously this behavior was
dialect dependent, with PostgreSQL, MySQL/MariaDB and SQLite supporting it,
and Oracle and SQL Server not supporting it. Third party dialects should
also seek to ensure their :meth:`_engine.Inspector.has_table` method
searches for views as well as tables for the given name.

Fixes: #7161
Change-Id: I9e523c76741b19596c81ef577dc6f0823e44183b
doc/build/changelog/unreleased_20/7161.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/testing/suite/test_reflection.py