classConflictDoNothing
final class ConflictDoNothing
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.ON CONFLICT [ conflict_target ] DO NOTHING: a row that would violate a unique constraint is not inserted.
Mirrors PostgreSQL's OnConflictClause with ONCONFLICT_NOTHING. Without a target, a conflict with any unique constraint is skipped. Source: https://www.postgresql.org/docs/17/sql-insert.html#SQL-ON-CONFLICT.
$insert = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('INSERT INTO t VALUES (1) ON CONFLICT DO NOTHING');
$insert->statement->conflict->target // => nullProperties§
public IndexInference|ConstraintInference|null $target = nullMethods§
public function __construct(public IndexInference|ConstraintInference|null $target = null)Parameters
$target | IndexInference|ConstraintInference|null | The conflict target |
public function render(Output $out): voidWrites ON CONFLICT, the target and DO NOTHING.
Parameters
$out | Output |
Calls 1
- method-call Output::keyword() line 39
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ConflictDoNothingTestcalls
Relations§
Instantiated in 1
Type declarations 5
- type SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:182
- type SqlSemantics\Platform\PostgreSql\Rules\Manipulation\InsertFacts packages/sql-semantics-postgres/src/Rules/Manipulation/InsertFacts.php:162
- type SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertDefaults packages/sql-semantics-postgres/src/Statement/Manipulation/InsertDefaults.php:53
- type SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertRows packages/sql-semantics-postgres/src/Statement/Manipulation/InsertRows.php:68
- type SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertSelect packages/sql-semantics-postgres/src/Statement/Manipulation/InsertSelect.php:72