Skip to main content

explain_if_requested

Function explain_if_requested 

pub fn explain_if_requested<P: Params>(
    db: &FactsDb,
    sql: &str,
    params: P,
    label: &str,
    opts: &Options,
) -> Result<()>
Expand description

Emit the DuckDB EXPLAIN plan for sql + params to stderr if opts.explain is on. No-op otherwise. Shared so every analysis can add --explain support in one line instead of copying the if opts.explain { db.explain_sql(...)?; eprintln!(...); } block.

§Errors

Returns CodeLoreError::Analysis only if --explain is on AND db.explain_sql fails. Off path is infallible.