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.

Reading a conflict clause without targetdoctest
$insert = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('INSERT INTO t VALUES (1) ON CONFLICT DO NOTHING');
    $insert->statement->conflict->target // => null

Properties§

public IndexInference|ConstraintInference|null $target = null

Methods§

public function __construct(public IndexInference|ConstraintInference|null $target = null)

Parameters

$targetIndexInference|ConstraintInference|nullThe conflict target
public function render(Output $out): void

Writes ON CONFLICT, the target and DO NOTHING.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 5