]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Allow metadata.reflect() to recover from unreflectable tables
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 22 May 2017 18:08:55 +0000 (14:08 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 22 May 2017 19:51:07 +0000 (15:51 -0400)
commit9f0fb6c601829cb7c9f449d57e12e8b95dab51f5
tree1201e89aa89fac39316ccfa87567a88b9667fa4c
parentda1bc9878b71f6f7b87e2fa7895e1631ae581609
Allow metadata.reflect() to recover from unreflectable tables

Added support for views that are unreflectable due to stale
table definitions, when calling :meth:`.MetaData.reflect`; a warning
is emitted for the table that cannot respond to ``DESCRIBE``
but the operation succeeds.  The MySQL dialect now
raises UnreflectableTableError which is in turn caught by
MetaData.reflect().  Reflecting the view standalone raises
this error directly.

Change-Id: Id8005219d8e073c154cc84a873df911b4a6cf4d6
Fixes: #3871
doc/build/changelog/changelog_12.rst
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/testing/assertions.py
test/dialect/mysql/test_reflection.py
test/engine/test_reflection.py