Batch INSERT fingerprint generation (from existing implementation)
(&self, query: &str)
| 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 { |