Enhanced fast path execution that supports WHERE clauses and parameters
(
conn: &Connection,
query: &str,
params: &[rusqlite::types::Value],
schema_cache: &SchemaCache,
)
| 485 | |
| 486 | /// Enhanced fast path execution that supports WHERE clauses and parameters |
| 487 | pub fn execute_fast_path_enhanced_with_params( |
| 488 | conn: &Connection, |
| 489 | query: &str, |
| 490 | params: &[rusqlite::types::Value], |
| 491 | schema_cache: &SchemaCache, |
| 492 | ) -> Result<Option<usize>, rusqlite::Error> { |
| 493 | // Try enhanced fast path detection |
| 494 | if let Some(fast_query) = can_use_fast_path_enhanced(query) { |
| 495 | // Skip SELECT queries here, they need special handling |
| 496 | if matches!(fast_query.operation, FastPathOperation::Select) { |
| 497 | return Ok(None); |
| 498 | } |
| 499 | |
| 500 | // Check if table has decimal columns |
| 501 | match table_has_decimal_columns(conn, &fast_query.table_name, schema_cache) { |
| 502 | Ok(false) => { |
| 503 | // No decimal columns, execute directly with parameters |
| 504 | let rows_affected = conn.execute(query, rusqlite::params_from_iter(params.iter()))?; |
| 505 | return Ok(Some(rows_affected)); |
| 506 | } |
| 507 | _ => { |
| 508 | // Has decimal columns or error checking, fall back to normal path |
| 509 | return Ok(None); |
| 510 | } |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | Ok(None) |
| 515 | } |
| 516 | |
| 517 | /// Enhanced fast path execution that supports WHERE clauses |
| 518 | pub fn execute_fast_path_enhanced( |
nothing calls this directly
no test coverage detected