MCPcopy Create free account
hub / github.com/erans/pgsqlite / generate_cache_key

Method generate_cache_key

src/cache/enhanced_statement_pool.rs:156–164  ·  view source on GitHub ↗

Generate a normalized cache key for the query

(&self, query: &str)

Source from the content-addressed store, hash-verified

154
155 /// Generate a normalized cache key for the query
156 fn generate_cache_key(&self, query: &str) -> String {
157 // First check for batch INSERT pattern (existing logic)
158 if let Some(fingerprint) = self.batch_insert_fingerprint(query) {
159 return fingerprint;
160 }
161
162 // Use enhanced query fingerprinting for better normalization
163 QueryFingerprint::generate(query).to_string()
164 }
165
166 /// Determine if a query should be cached based on its pattern and hints
167 fn should_cache_query(&self, pattern: &QueryPattern, hints: &OptimizationHints) -> bool {

Callers 2

Calls 1

Tested by 1