Skip to main content

ask_with_schema

Function ask_with_schema 

Source
pub fn ask_with_schema(
    schema_dump: &str,
    question: &str,
    config: &AskConfig,
) -> Result<AskResponse, AskError>
Expand description

One-shot natural-language → SQL.

You pass the schema dump as a string (typically produced by the engine’s sqlrite::ConnectionAskExt / dump_schema_for_database helper, but any string format the model can read is fine) and the user’s question. Returns the generated SQL plus a one-sentence rationale plus token usage for cache-hit verification.

The library does not execute the returned SQL — that’s the caller’s call. See module docs for rationale.