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— LiveTableRegistry; used to resolve store handles and schema configs from table names, and to collect table names forSourceSpec::Patternresolution.record— TheAliasRecordthat describes the alias (sources, aggregator, filter template, parameter schema, default limit).params— Optional JSON value used as the MiniJinja render context. Required whenrecord.params_schemaisSome; ignored (and silently accepted) whenNone.table_fallback— Legacy single-table mode: thetableargument supplied toalias_run. Used whenrecord.sourcesisSourceSpec::Singlewith an empty placeholder produced by the legacy per-table path. Ignored whenrecord.sourcesis already a fully populatedSingle/Multi/Pattern.limit_override— Caller-supplied row limit. Falls back torecord.default_limitwhenNone.offset— Number of rows to skip (plain Rows path only).fields— Field projection selector (plain Rows path only).
§Errors
MiniAppError::AliasParamsRequired—params_schemaisSomebutparamsisNone.MiniAppError::AliasTemplateError— MiniJinja render failure.- [
MiniAppError::Filter] — filter parse or validate failure. MiniAppError::Aggregator— aggregator execute failure.MiniAppError::TableNotFound— a referenced table is not in the registry.MiniAppError::Storage— underlying SQLite error.