MCPcopy Create free account
hub / github.com/cisco/mindmeld / key_to_row_id

Method key_to_row_id

mindmeld/query_cache.py:152–165  ·  view source on GitHub ↗

Args: key(str): A key generated by the QueryCache.get_key() function Returns: Optional(Integer): Unique id of the query in the cache if it exists

(self, key)

Source from the content-addressed store, hash-verified

150 return self.memory_connection or self.disk_connection
151
152 def key_to_row_id(self, key):
153 """
154 Args:
155 key(str): A key generated by the QueryCache.get_key() function
156 Returns:
157 Optional(Integer): Unique id of the query in the cache if it exists
158 """
159
160 cursor = self.connection.cursor()
161 cursor.execute("""
162 SELECT rowid FROM queries where hash_id=(?);
163 """, (key,))
164 row = cursor.fetchone()
165 return row[0] if row else None
166
167 def put(self, key, processed_query):
168 """

Callers 4

putMethod · 0.95
get_valueMethod · 0.95
cache_query_fileFunction · 0.80

Calls 1

executeMethod · 0.45

Tested by 1