MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _gen_cache_key

Method _gen_cache_key

lib/sqlalchemy/sql/elements.py:2160–2181  ·  view source on GitHub ↗
(self, anon_map, bindparams)

Source from the content-addressed store, hash-verified

2158 return c
2159
2160 def _gen_cache_key(self, anon_map, bindparams):
2161 _gen_cache_ok = self.__class__.__dict__.get("inherit_cache", False)
2162
2163 if not _gen_cache_ok:
2164 if anon_map is not None:
2165 anon_map[NO_CACHE] = True
2166 return None
2167
2168 id_, found = anon_map.get_anon(self)
2169 if found:
2170 return (id_, self.__class__)
2171
2172 if bindparams is not None:
2173 bindparams.append(self)
2174
2175 return (
2176 id_,
2177 self.__class__,
2178 self.type._static_cache_key,
2179 self.key % anon_map if self._key_is_anon else self.key,
2180 self.literal_execute,
2181 )
2182
2183 def _convert_to_unique(self):
2184 if not self.unique:

Callers 1

_gen_cache_keyMethod · 0.45

Calls 3

get_anonMethod · 0.80
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected