]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
factor single-table reflection wrappers into common mixin
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Jun 2026 20:02:02 +0000 (16:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 10 Jun 2026 19:21:28 +0000 (15:21 -0400)
commiteeedfc4d522b88df4e3855fed11d8b7da10b0f5b
tree08afdccc5d433bde7cd474045e15a9c20d464cfd
parent0798e6cbe11b302c86dedff3d8e75eeb8ae045be
factor single-table reflection wrappers into common mixin

Introduced _BackendsMultiReflection mixin in engine/default.py
that provides the get_columns(), get_pk_constraint(),
get_foreign_keys(), get_indexes(), get_unique_constraints(),
get_check_constraints(), get_table_comment(), and
get_table_options() single-table methods, each delegating to
the corresponding get_multi_* method with
filter_names=[table_name].

PostgreSQL, Oracle, and MSSQL dialects now inherit from this
mixin instead of duplicating the wrapper pattern.  Oracle
retains its _value_or_raise() override which applies
normalize_name() for case-folding.  MSSQL overrides
get_unique_constraints(), get_check_constraints(), and
get_table_options() with NotImplementedError since it has no
native get_multi_* for those yet.

Change-Id: If68bbf94b3956348fc7ae8179ff093d63dcdfbe2
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/engine/default.py