final class ConflictClause
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Conflict clause operations for PostgreSQL statement.

Methods§

public static function findOnConflictTargetStart(list<SqlToken> $tokens): ?int
public static function findTopLevelSymbol(
    list<SqlToken> $tokens,
    int $start,
    string $symbol,
): ?int
public static function findTopLevelKeyword(
    list<SqlToken> $tokens,
    int $start,
    string $keyword,
): ?int

Parameters

$tokenslist<SqlToken>
$startint
$keywordstring

Returns

?int
Test cases 1
Called from 1
Calls 1
public function extractOnConflictUpdateColumns(string $sql): array{columns: list<string>, values: array<string, string>}

Extract ON CONFLICT ... DO UPDATE SET columns and values.

Parameters

$sqlstring

Returns

array{columns: list<string>, values: array<string, string>}
Test cases 1
Called from 1
Calls 7
public function extractOnConflictUpdateWhere(string $sql): ?string
public function namedConstraint(list<SqlToken> $tokens, int $conflict): ?PgSqlConflictTarget
public function indexColumns(string $columnSql): list<string>|null

Requires each inferred-index item to consist of one identifier.

Parameters

$columnSqlstring

Returns

list<string>|null
Test cases 1
Called from 1
Calls 3
public function indexTarget(
    string $sql,
    list<SqlToken> $tokens,
    int $closing,
    list<string> $columns,
): ?PgSqlConflictTarget

Resolves the optional index predicate and requires an ON CONFLICT action.

Parameters

$sqlstring
$tokenslist<SqlToken>
$closingint
$columnslist<string>
Test cases 1
Called from 1
Calls 4
public function hasOnConflict(string $sql): bool

Check if INSERT has ON CONFLICT clause.

Parameters

$sqlstring

Returns

bool
Test cases 1
Called from 1
Calls 2

Test cases 27§

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

Dedicated tests 10
Other tests reaching this symbol 17

Relations§

Instantiated in 4
Method calls 4