final class FunctionShapes
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Derives the columns of a function call used as a FROM item.

Rule: PG-FUNCTION-TABLE-001. Each call is derived where the FROM items before it are visible. A call with column definitions has those columns, of the defined types; definitions for a call of a known type other than record are reported. A call of a base type has one column, named by the correlation name when it is the only call and has one, else by the function name. A call of type record without definitions has the columns of the routine's declaration, which the context cannot hold: the shape is open on the routine. A call whose type depends on missing declarations leaves the shape open on them. Under ROWS FROM the columns of the calls follow each other and can all be NULL, because shorter results are padded with NULLs. Column definitions written after the alias of ROWS FROM with several functions, or for a function that has its own, are reported (and still derived). WITH ORDINALITY adds the column ordinality of type bigint. The column aliases then rename the columns (PG-COLUMN-ALIAS-001). Source: https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-TABLEFUNCTIONS, https://www.postgresql.org/docs/17/sql-select.html#SQL-FROM. Status: Implemented.

Methods§

public function defined(
    list<TypedColumn> $definitions,
    ScalarFact $call,
    Derivation $derivation,
    Environment $environment,
): list<OutputSlot>
public function distinct(list<MissingInput> $missing): list<MissingInput>

Test cases 3§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3

Relations§

Instantiated in 2
Method calls 2