Skip to main content

run_query

Function run_query 

Source
pub fn run_query(
    cli: &Cli,
    query_string: &str,
    search_path: &str,
    explain: bool,
    verbose: bool,
    session_mode: bool,
    no_parallel: bool,
    timeout_secs: Option<u64>,
    result_limit: Option<usize>,
    variables: &[String],
) -> Result<()>
Expand description

Run a query command to search for symbols using AST-aware predicates

§Arguments

  • cli - CLI arguments
  • query_string - Query string with predicates (e.g., “kind:function AND name~=/test/”)
  • search_path - Path to search (file or directory)
  • explain - If true, explain the query instead of executing it
  • verbose - If true, show verbose output including cache statistics
  • session_mode - If true, use persistent session for repeated queries
  • no_parallel - If true, disable parallel query execution (for A/B testing)
  • timeout_secs - Query timeout in seconds (max 30s per security policy)
  • result_limit - Maximum number of results to return

§Errors

Returns an error if query validation fails, execution fails, or output cannot be written.