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

Function query_fast_path_enhanced_with_params

src/query/fast_path.rs:549–575  ·  view source on GitHub ↗

Enhanced fast path SELECT execution with parameters

(
    conn: &Connection,
    query: &str,
    params: &[rusqlite::types::Value],
    schema_cache: &SchemaCache,
)

Source from the content-addressed store, hash-verified

547
548/// Enhanced fast path SELECT execution with parameters
549pub fn query_fast_path_enhanced_with_params(
550 conn: &Connection,
551 query: &str,
552 params: &[rusqlite::types::Value],
553 schema_cache: &SchemaCache,
554) -> Result<Option<DbResponse>, rusqlite::Error> {
555 // Try enhanced fast path detection
556 if let Some(fast_query) = can_use_fast_path_enhanced(query) {
557 // Only handle SELECT queries
558 if !matches!(fast_query.operation, FastPathOperation::Select) {
559 return Ok(None);
560 }
561
562 // Check if table has decimal columns
563 match table_has_decimal_columns(conn, &fast_query.table_name, schema_cache) {
564 Ok(false) => {
565 return execute_fast_select_with_params(conn, query, &fast_query.table_name, params, schema_cache);
566 }
567 _ => {
568 // Has decimal columns or error checking, fall back to normal path
569 return Ok(None);
570 }
571 }
572 }
573
574 Ok(None)
575}
576
577/// Enhanced fast path SELECT execution that supports WHERE clauses
578pub fn query_fast_path_enhanced(

Callers

nothing calls this directly

Calls 3

Tested by

no test coverage detected