class ClauseAdapter(visitors.ReplacingExternalTraversal):
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 | _corresponding_column |
Undocumented |
Method | replace |
Receive pre-copied elements during a cloning traversal. |
Instance Variable | __traverse_options__ |
Undocumented |
Instance Variable | adapt_from_selectables |
Undocumented |
Instance Variable | adapt_on_names |
Undocumented |
Instance Variable | equivalents |
Undocumented |
Instance Variable | exclude_fn |
Undocumented |
Instance Variable | include_fn |
Undocumented |
Instance Variable | selectable |
Undocumented |
Inherited from ReplacingExternalTraversal
:
Method | traverse |
Traverse and visit the given expression structure. |
Inherited from CloningExternalTraversal
(via ReplacingExternalTraversal
):
Method | copy_and_process |
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 ClauseVisitor onto this ClauseVisitor. |
Method | iterate |
Traverse the given expression structure, returning an iterator of all elements. |
Method | traverse_single |
Undocumented |
Property | _visitor_dict |
Undocumented |
Property | visitor_iterator |
Iterate through this visitor and each 'chained' visitor. |
sqlalchemy.sql.util.ColumnAdapter
Undocumented
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.