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

Method batch_insert_fingerprint

src/cache/enhanced_statement_pool.rs:408–422  ·  view source on GitHub ↗

Batch INSERT fingerprint generation (from existing implementation)

(&self, query: &str)

Source from the content-addressed store, hash-verified

406
407 /// Batch INSERT fingerprint generation (from existing implementation)
408 fn batch_insert_fingerprint(&self, query: &str) -> Option<String> {
409 let upper_query = query.to_uppercase();
410
411 if !upper_query.contains("INSERT") || (!query.contains("),(") && !query.contains("), (")) {
412 return None;
413 }
414
415 if let Some(_values_pos) = upper_query.find("VALUES") {
416 let original_values_pos = query.to_uppercase().find("VALUES").unwrap();
417 let prefix = &query[..original_values_pos + 6].trim();
418 Some(format!("{prefix} (?)"))
419 } else {
420 None
421 }
422 }
423
424 /// Get current pool statistics
425 pub fn get_stats(&self) -> PoolStats {

Callers 1

generate_cache_keyMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected