class documentation

Undocumented

Class Variable __slots__ Undocumented
Method _gen_cache_key return an optional cache key.
Method _gen_cache_key_inst Undocumented
Method _generate_cache_key return a cache key.

Inherited from Options:

Class Method from_execution_options process Options argument in terms of execution options.
Class Method isinstance Undocumented
Class Method safe_merge Undocumented
Method __add__ Undocumented
Method __delattr__ Undocumented
Method __eq__ Undocumented
Method __getattr__ Undocumented
Method __init__ Undocumented
Method __init_subclass__ Undocumented
Method __repr__ Undocumented
Method __setattr__ Undocumented
Method add_to_element Undocumented
Method _state_dict Undocumented
Method _state_dict_inst Undocumented
Class Variable _cache_attrs Undocumented

Inherited from HasCacheKey (via Options):

Class Variable inherit_cache Indicate if this :class:`.HasCacheKey` instance should make use of the cache key generation scheme used by its immediate superclass.
Class Method _generate_cache_attrs generate cache key dispatcher for a new class.
Class Method _generate_cache_key_for_object Undocumented
Class Variable _generated_cache_key_traversal Undocumented
Class Variable _hierarchy_supports_caching private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses.
Class Variable _is_has_cache_key Undocumented
@_gen_cache_key_inst.classlevel
def _gen_cache_key(cls, anon_map, bindparams): (source)

return an optional cache key. The cache key is a tuple which can contain any series of objects that are hashable and also identifies this object uniquely within the presence of a larger SQL expression or statement, for the purposes of caching the resulting query. The cache key should be based on the SQL compiled structure that would ultimately be produced. That is, two structures that are composed in exactly the same way should produce the same cache key; any difference in the structures that would affect the SQL string or the type handlers should result in a different cache key. If a structure cannot produce a useful cache key, the NO_CACHE symbol should be added to the anon_map and the method should return None.

@hybridmethod
def _gen_cache_key_inst(self, anon_map, bindparams): (source)

Undocumented

@hybridmethod
def _generate_cache_key(self): (source)

return a cache key. The cache key is a tuple which can contain any series of objects that are hashable and also identifies this object uniquely within the presence of a larger SQL expression or statement, for the purposes of caching the resulting query. The cache key should be based on the SQL compiled structure that would ultimately be produced. That is, two structures that are composed in exactly the same way should produce the same cache key; any difference in the structures that would affect the SQL string or the type handlers should result in a different cache key. The cache key returned by this method is an instance of :class:`.CacheKey`, which consists of a tuple representing the cache key, as well as a list of :class:`.BindParameter` objects which are extracted from the expression. While two expressions that produce identical cache key tuples will themselves generate identical SQL strings, the list of :class:`.BindParameter` objects indicates the bound values which may have different values in each one; these bound parameters must be consulted in order to execute the statement with the correct parameters. a :class:`_expression.ClauseElement` structure that does not implement a :meth:`._gen_cache_key` method and does not implement a :attr:`.traverse_internals` attribute will not be cacheable; when such an element is embedded into a larger structure, this method will return None, indicating no cache key is available.