Skip to main content

execute_alias_run

Function execute_alias_run 

Source
pub async fn execute_alias_run(
    registry: &TableRegistry,
    record: AliasRecord,
    params: Option<Value>,
    table_fallback: Option<&str>,
    limit_override: Option<u32>,
    offset: Option<u32>,
    fields: Option<FieldSelector>,
) -> Result<AliasRunValue, MiniAppError>
Expand description

Execute an alias and return the typed result.

This is the canonical alias_run implementation. Both the MCP alias_run tool handler and direct SDK consumers call this function.

§Arguments

  • registry — Live TableRegistry; used to resolve store handles and schema configs from table names, and to collect table names for SourceSpec::Pattern resolution.
  • record — The AliasRecord that describes the alias (sources, aggregator, filter template, parameter schema, default limit).
  • params — Optional JSON value used as the MiniJinja render context. Required when record.params_schema is Some; ignored (and silently accepted) when None.
  • table_fallback — Legacy single-table mode: the table argument supplied to alias_run. Used when record.sources is SourceSpec::Single with an empty placeholder produced by the legacy per-table path. Ignored when record.sources is already a fully populated Single/Multi/Pattern.
  • limit_override — Caller-supplied row limit. Falls back to record.default_limit when None.
  • offset — Number of rows to skip (plain Rows path only).
  • fields — Field projection selector (plain Rows path only).

§Errors