class InternalTraversal(util.with_metaclass(_InternalTraversalType, object)):
Known subclasses: sqlalchemy.sql.traversals._CopyInternals
, sqlalchemy.sql.traversals._GetChildren
, sqlalchemy.sql.traversals.TraversalComparatorStrategy
, sqlalchemy.sql.visitors.ExtendedInternalTraversal
Defines visitor symbols used for internal traversal.
The .InternalTraversal
class is used in two ways. One is that
it can serve as the superclass for an object that implements the
various visit methods of the class. The other is that the symbols
themselves of .InternalTraversal
are used within
the _traverse_internals collection. Such as, the .Case
object defines _traverse_internals as
_traverse_internals = [ ("value", InternalTraversal.dp_clauseelement), ("whens", InternalTraversal.dp_clauseelement_tuples), ("else_", InternalTraversal.dp_clauseelement), ]
Above, the .Case
class indicates its internal state as the
attributes named value, whens, and else_. They each
link to an .InternalTraversal
method which indicates the type
of datastructure referred towards.
Using the _traverse_internals structure, objects of type
.InternalTraversible
will have the following methods automatically
implemented:
.Traversible.get_children
.Traversible._copy_internals
.Traversible._gen_cache_key
Subclasses can also implement these methods directly, particularly for the
.Traversible._copy_internals
method, when special steps
are needed.
Method | dispatch |
Given a method from .InternalTraversal , return the corresponding method on a subclass. |
Class Variable | dp_annotations_key |
Visit the _annotations_cache_key element. |
Class Variable | dp_anon_name |
Visit a potentially "anonymized" string value. |
Class Variable | dp_boolean |
Visit a boolean value. |
Class Variable | dp_clauseelement |
Visit a _expression.ClauseElement object. |
Class Variable | dp_clauseelement_list |
Visit a list of _expression.ClauseElement objects. |
Class Variable | dp_clauseelement_tuple |
Visit a tuple of _expression.ClauseElement objects. |
Class Variable | dp_clauseelement_tuples |
Visit a list of tuples which contain _expression.ClauseElement objects. |
Class Variable | dp_dialect_options |
Visit a dialect options structure. |
Class Variable | dp_dml_multi_values |
Visit the values() multi-valued list of dictionaries of an _expression.Insert object. |
Class Variable | dp_dml_ordered_values |
Visit the values() ordered tuple list of an _expression.Update object. |
Class Variable | dp_dml_values |
Visit the values() dictionary of a .ValuesBase (e.g. Insert or Update) object. |
Class Variable | dp_fromclause_canonical_column_collection |
Visit a _expression.FromClause object in the context of the columns attribute. |
Class Variable | dp_fromclause_ordered_set |
Visit an ordered set of _expression.FromClause objects. |
Class Variable | dp_has_cache_key |
Visit a .HasCacheKey object. |
Class Variable | dp_has_cache_key_list |
Visit a list of .HasCacheKey objects. |
Class Variable | dp_named_ddl_element |
Visit a simple named DDL element. |
Class Variable | dp_operator |
Visit an operator. |
Class Variable | dp_plain_dict |
Visit a dictionary with string keys. |
Class Variable | dp_plain_obj |
Visit a plain python object. |
Class Variable | dp_prefix_sequence |
Visit the sequence represented by _expression.HasPrefixes or _expression.HasSuffixes . |
Class Variable | dp_propagate_attrs |
Visit the propagate attrs dict. This hardcodes to the particular elements we care about right now. |
Class Variable | dp_statement_hint_list |
Visit the _statement_hints collection of a _expression.Select object. |
Class Variable | dp_string |
Visit a plain string value. |
Class Variable | dp_string_clauseelement_dict |
Visit a dictionary of string keys to _expression.ClauseElement objects. |
Class Variable | dp_string_list |
Visit a list of strings. |
Class Variable | dp_string_multi_dict |
Visit a dictionary of string keys to values which may either be plain immutable/hashable or .HasCacheKey objects. |
Class Variable | dp_table_hint_list |
Visit the _hints collection of a _expression.Select object. |
Class Variable | dp_type |
Visit a .TypeEngine object |
Class Variable | dp_unknown_structure |
Visit an unknown structure. |
Method | generate_dispatch |
Undocumented |
Method | run_generated_dispatch |
Undocumented |
Class Variable | dp_executable_options |
Undocumented |
Class Variable | dp_memoized_select_entities |
Undocumented |
Class Variable | dp_setup_join_tuple |
Undocumented |
Class Variable | dp_with_context_options |
Undocumented |
.InternalTraversal
, return the
corresponding method on a subclass.Visit the _annotations_cache_key element.
This is a dictionary of additional information about a ClauseElement that modifies its role. It should be included when comparing or caching objects, however generating this key is relatively expensive. Visitors should check the "_annotations" dict for non-None first before creating this key.
Visit a potentially "anonymized" string value.
The string value is considered to be significant for cache key generation.
Visit a boolean value.
The boolean value is considered to be significant for cache key generation.
_expression.Insert
object.Visit a _expression.FromClause
object in the context of the
columns attribute.
The column collection is "canonical", meaning it is the originally
defined location of the .ColumnClause
objects. Right now
this means that the object being visited is a
_expression.TableClause
or _schema.Table
object only.
Visit a simple named DDL element.
The current object used by this method is the .Sequence
.
The object is only considered to be important for cache key generation as far as its name, but not any other aspects of it.
Visit an operator.
The operator is a function from the sqlalchemy.sql.operators
module.
The operator value is considered to be significant for cache key generation.
Visit a dictionary with string keys.
The keys of the dictionary should be strings, the values should be immutable and hashable. The dictionary is considered to be significant for cache key generation.
Visit a plain python object.
The value should be immutable and hashable, such as an integer. The value is considered to be significant for cache key generation.
_expression.HasPrefixes
or _expression.HasSuffixes
.Visit a plain string value.
Examples include table and column names, bound parameter keys, special keywords such as "UNION", "UNION ALL".
The string value is considered to be significant for cache key generation.
_expression.ClauseElement
objects..HasCacheKey
objects.