MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / cache_query_result

Method cache_query_result

graphlite/src/cache/cache_manager.rs:252–271  ·  view source on GitHub ↗

Cache query result

(
        &self,
        query: &str,
        parameters: Vec<CacheParameter>,
        user_context: Option<String>,
        result: QueryResult,
        execution_time: Duration,
        plan_hash: u

Source from the content-addressed store, hash-verified

250
251 /// Cache query result
252 pub fn cache_query_result(
253 &self,
254 query: &str,
255 parameters: Vec<CacheParameter>,
256 user_context: Option<String>,
257 result: QueryResult,
258 execution_time: Duration,
259 plan_hash: u64,
260 ) {
261 if !self.config.enabled {
262 return;
263 }
264
265 let graph_version = *self.graph_version.read().unwrap();
266 let key = create_query_cache_key(query, parameters, graph_version, user_context);
267
268 self.result_cache
269 .insert(key, result, execution_time, plan_hash);
270 self.update_global_stats();
271 }
272
273 /// Get cached query plan
274 pub fn get_query_plan(

Callers

nothing calls this directly

Calls 4

create_query_cache_keyFunction · 0.85
unwrapMethod · 0.80
update_global_statsMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected