Visitor/traversal interface and library functions.
SQLAlchemy schema and expression constructs rely on a Python-centric version of the classic "visitor" pattern as the primary way in which they apply functionality. The most common use of this pattern is statement compilation, where individual expression classes match up to rendering methods that produce a string result. Beyond this, the visitor system is also used to inspect expressions for various information and patterns, as well as for usage in some kinds of expression transformation. Other kinds of transformation use a non-visitor traversal system.
For many examples of how the visit system is used, see the sqlalchemy.sql.util and the sqlalchemy.sql.compiler modules. For an introduction to clause adaption, see http://techspot.zzzeek.org/?p=19 .
clone the given expression structure, allowing modifications by visitors.
traverse the given expression structure, returning an iterator.
traversal is configured to be breadth-first.
traverse the given expression structure, returning an iterator.
traversal is configured to be depth-first.
clone the given expression structure, allowing element replacement by a given replacement function.
Base class for visitor objects which can traverse using the traverse() function.
'chain' an additional ClauseVisitor onto this ClauseVisitor.
the chained visitor will receive all visit events after this one.
traverse the given expression structure, returning an iterator of all elements.
Base class for visitor objects which can traverse using the cloned_traverse() function.
Apply cloned traversal to the given list of elements, and return the new list.
Base class for visitor objects which can traverse using the replacement_traverse() function.
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.
Base class for visitable objects, applies the VisitableType metaclass.
Metaclass which applies a __visit_name__ attribute and _compiler_dispatch method to classes.