]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
warn and skip for FKs that refer to invisible cols for Oracle
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 5 Jan 2023 15:34:37 +0000 (10:34 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 9 Jan 2023 14:51:03 +0000 (09:51 -0500)
commit3aeb30ea104ca6cbe6972f7ec64233cadbaccd82
tree72a21cad47aaad28e11428b646883e18df4903e7
parentaafded2fe6f955d23ab974574978f2a6f96234b9
warn and skip for FKs that refer to invisible cols for Oracle

Supported use case for foreign key constraints where the local column is
marked as "invisible". The errors normally generated when a
:class:`.ForeignKeyConstraint` is created that check for the target column
are disabled when reflecting, and the constraint is skipped with a warning
in the same way which already occurs for an :class:`.Index` with a similar
issue.

tests are added for indexes, unique constraints, and primary key
constraints, which were already working; indexes and uniques warn,
primary keys don't which we would assume is because we never see those
PK columns in the first place.

Constraints now raise an informative ConstraintColumnNotFoundError
in the general case for strings in the "pending colargs" collection
not being resolvable.

Fixes: #9059
Change-Id: I400cf0bff6abba0e0c75f38b07617be1a8ec3453
doc/build/changelog/unreleased_20/9059.rst [new file with mode: 0644]
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/sql/schema.py
test/base/test_except.py
test/dialect/oracle/test_reflection.py
test/sql/test_metadata.py