]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add resolve_fks=False option for reflection
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 28 Feb 2019 15:59:41 +0000 (10:59 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 28 Feb 2019 18:49:09 +0000 (13:49 -0500)
commita690ec082451ca0636fb45a0d9773a240ae30373
tree427ce67495efa3447dd4326448b4a93158826a0c
parent358a0dcf10c27b3f209ac887be9960eccd588a7d
Add resolve_fks=False option for reflection

Added new parameters :paramref:`.Table.resolve_fks` and
:paramref:`.MetaData.reflect.resolve_fks` which when set to False will
disable the automatic reflection of related tables encountered in
:class:`.ForeignKey` objects, which can both reduce SQL overhead for omitted
tables as well as avoid tables that can't be reflected for database-specific
reasons.  Two :class:`.Table` objects present in the same :class:`.MetaData`
collection can still refer to each other even if the reflection of the two
tables occurred separately.

Fixes: #4517
Change-Id: I623baed42042a16c5109e4c8af6b2f64d2d00f95
doc/build/changelog/unreleased_13/4517.rst [new file with mode: 0644]
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/sql/schema.py
test/engine/test_reflection.py