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

Function query_fast_path_enhanced

src/query/fast_path.rs:578–604  ·  view source on GitHub ↗

Enhanced fast path SELECT execution that supports WHERE clauses

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

Source from the content-addressed store, hash-verified

576
577/// Enhanced fast path SELECT execution that supports WHERE clauses
578pub fn query_fast_path_enhanced(
579 conn: &Connection,
580 query: &str,
581 schema_cache: &SchemaCache,
582) -> Result<Option<DbResponse>, rusqlite::Error> {
583 // Try enhanced fast path detection
584 if let Some(fast_query) = can_use_fast_path_enhanced(query) {
585 // Only handle SELECT queries
586 if !matches!(fast_query.operation, FastPathOperation::Select) {
587 return Ok(None);
588 }
589
590 // Check if table has decimal columns
591 match table_has_decimal_columns(conn, &fast_query.table_name, schema_cache) {
592 Ok(false) => {
593 return execute_fast_select(conn, query, &fast_query.table_name, schema_cache);
594 }
595 _ => {
596 // Has decimal columns or error checking, fall back to normal path
597 return Ok(None);
598 }
599 }
600 }
601
602 // Fall back to legacy fast path
603 query_fast_path(conn, query, schema_cache)
604}
605
606/// Execute a fast SELECT query with parameters
607fn execute_fast_select_with_params(

Callers

nothing calls this directly

Calls 4

execute_fast_selectFunction · 0.85
query_fast_pathFunction · 0.85

Tested by

no test coverage detected