enum MergeMatch
Public API: explicitly declared with @visibility public.

Which rows a WHEN clause of MERGE applies to.

Mirrors PostgreSQL's MergeMatchKind: MERGE_WHEN_MATCHED (a target row joined with a source row), MERGE_WHEN_NOT_MATCHED_BY_SOURCE (a target row without source row, PostgreSQL 17) and MERGE_WHEN_NOT_MATCHED_BY_TARGET (a source row without target row, written NOT MATCHED or, in PostgreSQL 17, NOT MATCHED BY TARGET). Source: https://www.postgresql.org/docs/17/sql-merge.html.

Reading the kind of a WHEN clausedoctest
$merge = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('MERGE INTO t USING u ON t.a = u.a WHEN NOT MATCHED BY TARGET THEN DO NOTHING');
    [$merge->statement->clauses[0]->match, $merge->toString()] // => [\SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge\MergeMatch::NotMatched, 'MERGE INTO t USING u ON t.a = u.a WHEN NOT MATCHED THEN DO NOTHING']

Cases§

case Matched
case NotMatchedBySource
case NotMatched

Methods§

public function targeted(): bool

Tells whether the clause applies to rows that have a target row: MATCHED and NOT MATCHED BY SOURCE.

Returns

bool
Called from 1
Calls 1

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Method calls 1
Constant reads 16
Type declarations 1