class documentation

The key used to identify a SQL statement construct in the SQL compilation cache. .. seealso:: :ref:`sql_caching`

Method __eq__ Undocumented
Method __hash__ CacheKey itself is not hashable - hash the .key portion
Method __str__ Undocumented
Method to_offline_string Generate an "offline string" form of this :class:`.CacheKey`
Class Variable bindparams Undocumented
Class Variable key Undocumented
Class Method _diff_tuples Undocumented
Method _apply_params_to_element Undocumented
Method _diff Undocumented
Method _generate_param_dict used for testing
Method _whats_different Undocumented
def __eq__(self, other: Any) -> bool: (source)

Undocumented

def __hash__(self) -> Optional[int]: (source)

CacheKey itself is not hashable - hash the .key portion

def __str__(self) -> str: (source)

Undocumented

def to_offline_string(self, statement_cache: MutableMapping[Any, str], statement: ClauseElement, parameters: _CoreSingleExecuteParams) -> str: (source)

Generate an "offline string" form of this :class:`.CacheKey` The "offline string" is basically the string SQL for the statement plus a repr of the bound parameter values in series. Whereas the :class:`.CacheKey` object is dependent on in-memory identities in order to work as a cache key, the "offline" version is suitable for a cache that will work for other processes as well. The given ``statement_cache`` is a dictionary-like object where the string form of the statement itself will be cached. This dictionary should be in a longer lived scope in order to reduce the time spent stringifying statements.

Undocumented

Undocumented

@classmethod
def _diff_tuples(cls, left: CacheKey, right: CacheKey) -> str: (source)

Undocumented

def _apply_params_to_element(self, original_cache_key: CacheKey, target_element: ClauseElement) -> ClauseElement: (source)

Undocumented

def _diff(self, other: CacheKey) -> str: (source)

Undocumented

def _generate_param_dict(self) -> Dict[str, Any]: (source)

used for testing

def _whats_different(self, other: CacheKey) -> Iterator[str]: (source)

Undocumented