final class JoinOperator
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The operator between two terms of a FROM clause: a comma, JOIN, or JOIN after up to three words.

Rule: SQLITE-JOIN-OPERATOR-001. The grammar admits one join keyword and then up to two arbitrary names before JOIN; SQLite accepts the words only when each is a join keyword and the combination is meaningful. A word that is no bare join keyword is kept as the name written. NATURAL merges the common columns; LEFT, RIGHT and FULL select the sides whose rows are extended with NULLs (LEFT and RIGHT together are FULL); INNER or CROSS with an outer keyword, OUTER alone, and any other word are an unknown join type, which SQLite reports and treats as an inner join. Source: https://sqlite.org/lang_select.html#the_from_clause. Status: Implemented.

Reading the meaning of a join operatordoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT 1 FROM t NATURAL LEFT JOIN u');
    $operator = $query->statement->from->steps[0]->operator;
    [$operator->natural(), $operator->left(), $operator->right(), $operator->valid()] // => [true, true, false, true]
Refusing words after a commadoctest
new \SqlSemantics\Platform\Sqlite\Statement\Relation\JoinOperator(true, [\SqlSemantics\Platform\Sqlite\Statement\Relation\JoinKeyword::Left]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction

Properties§

public list<JoinKeyword|Name> $words
public bool $comma = false

Methods§

public function __construct(public bool $comma = false, list<JoinKeyword|Name> $words = [])

Parameters

$commaboolWhether the operator is a comma
$wordslist<JoinKeyword|Name>The words before JOIN: a join keyword first, then up to two keywords or names

Throws

InvalidConstruction When the words are not what the grammar admits before JOIN
Calls 6
public function natural(): bool

Tells whether the join merges the columns common to both sides.

Returns

bool
Test cases 1
Calls 3
public function left(): bool

Tells whether the rows of the right side can be extended with NULLs.

Returns

bool
Test cases 1
Calls 4
public function right(): bool

Tells whether the rows of the left side can be extended with NULLs.

Returns

bool
Test cases 1
Calls 4
public function render(Output $out): void

Writes the operator.

Parameters

$outOutput
Calls 4

Test cases 23§

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

Dedicated tests 8
Other tests reaching this symbol 15

Relations§

Instantiated in 2
Type declarations 2