classStatementParts
final class StatementParts
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Resolves the target, join and branch spans of a MERGE statement.
Methods§
public function target(
string $sql,
string $statementSql,
list<SqlToken> $tokens,
): array{name: string, sql: string, alias: string, using: SqlToken}Resolves the target, alias and USING delimiter after MERGE modifiers.
Parameters
$sql | string | |
$statementSql | string | |
$tokens | list<SqlToken> |
Returns
array{name: string, sql: string, alias: string, using: SqlToken}Throws
Test cases 2
Called from 1
Calls 7
- new UnsupportedSqlException line 28
- method-call RelationTarget::relationAt() line 43
- new RelationTarget line 43
- method-call RelationTarget::isSymbol() line 48
- method-call BranchTokens::keywordIndexAfter() line 53
- new BranchTokens line 53
- method-call RelationTarget::targetAlias() line 57
public function join(
string $sql,
string $statementSql,
list<SqlToken> $tokens,
SqlToken $usingToken,
): array{source: string, condition: string, when: list<SqlToken>}Separates the source relation and join condition before the first branch.
Returns
array{source: string, condition: string, when: list<SqlToken>}Throws
Test cases 1
Called from 1
Calls 7
- method-call BranchTokens::mergeWhenTokens() line 70
- new BranchTokens line 70
- new UnsupportedSqlException line 73
- method-call BranchTokens::lastKeywordBetween() line 75
- function-call
trimline 80 - function-call
substrline 80 - method-call SqlToken::endOffset() line 82
public function clauses(
string $sql,
string $statementSql,
list<SqlToken> $whenTokens,
): non-empty-list<PgSqlMergeClause>Parses every WHEN branch using its exact source offsets.
Parameters
$sql | string | |
$statementSql | string | |
$whenTokens | list<SqlToken> |
Returns
non-empty-list<PgSqlMergeClause>Throws
Test cases 1
Called from 1
Calls 5
- function-call
strlenline 112 - function-call
substrline 113 - method-call ActionClause::parseClause() line 114
- new ActionClause line 114
- new UnsupportedSqlException line 117
Test cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 10
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsMatchConditionsTestcallsRowActionsTestcallsMergeTransformerTestcallsPgSqlTransformerTestcallsRowMutationResolverTestcallsPgSqlMutationResolverTestcallsPgSqlMergeParserTestcalls
Relations§
Instantiated in 1
Method calls 3
- method-call ZtdQuery\Platform\Postgres\Sql\Merge\PgSqlMergeParser::parse() packages/ztd-query-postgres/src/Sql/Merge/PgSqlMergeParser.php:36
- method-call ZtdQuery\Platform\Postgres\Sql\Merge\PgSqlMergeParser::parse() packages/ztd-query-postgres/src/Sql/Merge/PgSqlMergeParser.php:37
- method-call ZtdQuery\Platform\Postgres\Sql\Merge\PgSqlMergeParser::parse() packages/ztd-query-postgres/src/Sql/Merge/PgSqlMergeParser.php:44