enumMergeMatch
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.
$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 Matchedcase NotMatchedBySourcecase NotMatchedMethods§
public function targeted(): boolTells whether the clause applies to rows that have a target row: MATCHED and NOT MATCHED BY SOURCE.
Returns
boolCalled from 1
Calls 1
- class-const MergeMatch::NotMatched() line 33
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
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:42
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:43
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:44
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:45
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:46
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:58
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:59
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:60
- class-const SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:61
- class-const SqlSemantics\Platform\PostgreSql\Rules\Manipulation\MergeFacts::derive() packages/sql-semantics-postgres/src/Rules/Manipulation/MergeFacts.php:63
- class-const SqlSemantics\Platform\PostgreSql\Rules\Manipulation\MergeFacts::derive() packages/sql-semantics-postgres/src/Rules/Manipulation/MergeFacts.php:64
- class-const SqlSemantics\Platform\PostgreSql\Rules\Manipulation\MergeFacts::derive() packages/sql-semantics-postgres/src/Rules/Manipulation/MergeFacts.php:65
- class-const SqlSemantics\Platform\PostgreSql\Rules\Manipulation\MergeFacts::bySource() packages/sql-semantics-postgres/src/Rules/Manipulation/MergeFacts.php:119
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge\MergeWhen::render() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge/MergeWhen.php:56
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge\MergeWhen::render() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge/MergeWhen.php:57
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge\MergeWhen::render() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge/MergeWhen.php:58