SqlExpression.SchemaFrom

ExpressionInternal

Returns schema information from a SQL-related expression. Intended for internal use only.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

SqlExpression.SchemaFrom(schema as any) as any

Parameters

NameTypeRequiredDescription
schemaanyYesThe schema value to process.

Return Value

anySchema information derived from the provided input.

Remarks

SqlExpression.SchemaFrom is an internal-only function as stated in the official Microsoft documentation. It is part of the SqlExpression family of functions that support query folding infrastructure within the Power Query engine.

This function is used internally by the engine and custom SQL-based connectors to extract or process schema information from SQL-related expressions. The schema information is typically used during query folding to map M table types to SQL table schemas.

For standard M query development, this function has no practical use. Custom connector developers working with SQL-based data sources should refer to the Power Query SDK documentation for guidance on implementing query folding using Table.View handlers.

Examples

Example 1: Conceptual usage

let
    // SqlExpression.SchemaFrom is used internally by the Power Query engine
    // for SQL query folding. It is not intended for direct use in M queries.
    //
    // Custom connector developers implement query folding via Table.View handlers,
    // which may use SqlExpression functions behind the scenes.
    Result = "See Table.View for query folding patterns"
in
    Result

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks