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

Extracts PostgreSQL INSERT columns, values and query sources.

Methods§

public function extractInsertColumns(string $sql): list<string>
public function extractParenthesizedList(
    string $str,
    int $start,
): array{items: list<string>, end: int}|null

Parameters

$strstring
$startint

Returns

array{items: list<string>, end: int}|null
Test cases 1
Called from 1
Calls 5
public function extractInsertValues(string $sql): list<list<string>>

Extract VALUES rows from INSERT statement.

Parameters

$sqlstring

Returns

list<list<string>>
Test cases 1
Called from 1
Calls 5
public function hasInsertSelect(string $sql): bool

Check if INSERT has a SELECT subquery (INSERT ... SELECT).

Parameters

$sqlstring

Returns

bool
Test cases 1
Called from 1
Calls 2
public function extractInsertSelectSql(string $sql): ?string
public function appendListCharacter(
    string $char,
    int $depth,
    int &$bracketDepth,
    list<string> &$items,
    string &$current,
): void

Appends a value character, treating array brackets as comma nesting.

Parameters

$charstring
$depthint
$bracketDepthint
$itemslist<string>
$currentstring
Test cases 1
Called from 1
Calls 1

Test cases 26§

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

Dedicated tests 7
Other tests reaching this symbol 19

Relations§

Instantiated in 4
Method calls 4