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

Function execute_fast_path_enhanced

src/query/fast_path.rs:518–546  ·  view source on GitHub ↗

Enhanced fast path execution that supports WHERE clauses

(
    conn: &Connection,
    query: &str,
    schema_cache: &SchemaCache,
)

Source from the content-addressed store, hash-verified

516
517/// Enhanced fast path execution that supports WHERE clauses
518pub fn execute_fast_path_enhanced(
519 conn: &Connection,
520 query: &str,
521 schema_cache: &SchemaCache,
522) -> Result<Option<usize>, rusqlite::Error> {
523 // Try enhanced fast path detection
524 if let Some(fast_query) = can_use_fast_path_enhanced(query) {
525 // Skip SELECT queries here, they need special handling
526 if matches!(fast_query.operation, FastPathOperation::Select) {
527 return Ok(None);
528 }
529
530 // Check if table has decimal columns
531 match table_has_decimal_columns(conn, &fast_query.table_name, schema_cache) {
532 Ok(false) => {
533 // No decimal columns, execute directly
534 let rows_affected = conn.execute(query, [])?;
535 return Ok(Some(rows_affected));
536 }
537 _ => {
538 // Has decimal columns or error checking, fall back to normal path
539 return Ok(None);
540 }
541 }
542 }
543
544 // Fall back to legacy fast path
545 execute_fast_path(conn, query, schema_cache)
546}
547
548/// Enhanced fast path SELECT execution with parameters
549pub fn query_fast_path_enhanced_with_params(

Callers

nothing calls this directly

Calls 4

execute_fast_pathFunction · 0.85
executeMethod · 0.45

Tested by

no test coverage detected