final class QueryFact
    uses Snapshot
Public API: explicitly declared with @visibility public.

What an operation derived for the output of one query.

The projection lists the output fields in order. A star that missing declarations prevent from expanding stays a typed request and leaves the shape open; no field is invented for it.

Reading the output of a querydoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT 1 AS a, 2 AS b');
    [count($query->facts->output->projection), $query->facts->output->shape->complete()] // => [2, true]

Properties§

public list<Field|OpenStar> $projection
public RowShape $shape
public Comparison $names

Methods§

public function __construct(array<array-key, object> $projection, public Comparison $names)

Parameters

$projectionarray<array-key, object>The output fields and unexpandable stars in order, as a list of Field and OpenStar
$namesComparisonHow output names are compared

Throws

InvalidConstruction When the projection holds anything but fields and open stars
Calls 5
public function fields(): ?Fields

Answers the complete field list, or null while a star cannot be expanded.

Returns

Called from 1
Calls 1
public function lookup(string $name): FieldLookup

Looks an output field up by name without choosing among several or guessing in an open shape.

Parameters

$namestring
Calls 3

Test cases 8§

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

Other tests reaching this symbol 8

Relations§

Instantiated in 9
Type declarations 36