class CacheKey(namedtuple('CacheKey', ['key', 'bindparams'])):
The key used to identify a SQL statement construct in the SQL compilation cache.
See Also
Method | to_offline_string |
Generate an "offline string" form of this .CacheKey |
Class Method | _diff_tuples |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __hash__ |
CacheKey itself is not hashable - hash the .key portion |
Method | __str__ |
Undocumented |
Method | _apply_params_to_element |
Undocumented |
Method | _diff |
Undocumented |
Method | _generate_param_dict |
used for testing |
Method | _whats_different |
Undocumented |
Generate an "offline string" form of this .CacheKey
The "offline string" is basically the string SQL for the
statement plus a repr of the bound parameter values in series.
Whereas the .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.