class ClauseAdapter(visitors.ReplacingExternalTraversal): (source)
Known subclasses: sqlalchemy.sql.util.ColumnAdapter
Clones and modifies clauses based on column correspondence. E.g.:: table1 = Table('sometable', metadata, Column('col1', Integer), Column('col2', Integer) ) table2 = Table('someothertable', metadata, Column('col1', Integer), Column('col2', Integer) ) condition = table1.c.col1 == table2.c.col1 make an alias of table1:: s = table1.alias('foo') calling ``ClauseAdapter(s).traverse(condition)`` converts condition to read:: s.c.col1 == table2.c.col1
Method | __init__ |
Undocumented |
Method | replace |
Receive pre-copied elements during a cloning traversal. |
Method | traverse |
Traverse and visit the given expression structure. |
Class Variable | __slots__ |
Undocumented |
Instance Variable | __traverse |
Undocumented |
Instance Variable | adapt |
Undocumented |
Instance Variable | adapt |
Undocumented |
Instance Variable | equivalents |
Undocumented |
Instance Variable | exclude |
Undocumented |
Instance Variable | include |
Undocumented |
Instance Variable | selectable |
Undocumented |
Method | _corresponding |
Undocumented |
Inherited from CloningExternalTraversal
(via ReplacingExternalTraversal
):
Method | copy |
Apply cloned traversal to the given list of elements, and return the new list. |
Inherited from ExternalTraversal
(via ReplacingExternalTraversal
, CloningExternalTraversal
):
Method | chain |
'Chain' an additional ExternalTraversal onto this ExternalTraversal |
Method | iterate |
Traverse the given expression structure, returning an iterator of all elements. |
Method | traverse |
Undocumented |
Property | visitor |
Iterate through this visitor and each 'chained' visitor. |
Method | _memoized |
Undocumented |
Class Variable | _next |
Undocumented |
Inherited from MemoizedSlots
(via ReplacingExternalTraversal
, CloningExternalTraversal
, ExternalTraversal
):
Method | __getattr__ |
Undocumented |
Method | _fallback |
Undocumented |
Selectable
, equivalents: Optional[ _EquivalentColumnMap]
= None, include_fn: Optional[ Callable[ [ ClauseElement], bool]]
= None, exclude_fn: Optional[ Callable[ [ ClauseElement], bool]]
= None, adapt_on_names: bool
= False, anonymize_labels: bool
= False, adapt_from_selectables: Optional[ AbstractSet[ FromClause]]
= None):
(source)
¶
sqlalchemy.sql.util.ColumnAdapter
Undocumented
def replace(self, col:
_ET
, _include_singleton_constants: bool
= False) -> Optional[ _ET]
:
(source)
¶
Receive pre-copied elements during a cloning traversal. If the method returns a new element, the element is used instead of creating a simple copy of the element. Traversal will halt on the newly returned element if it is re-encountered.
sqlalchemy.sql.util.ColumnAdapter
Traverse and visit the given expression structure.