classPgSqlUpsertExpressionParser
final class PgSqlUpsertExpressionParser
Upsert expression parser for PostgreSQL queries.
Methods§
public function parse(string $sql, string $tableName): UpsertExpressionParses PostgreSQL SQL into the supported structural representation.
Parameters
$sql | string | |
$tableName | string |
Returns
Throws
Test cases 6
PgSqlUpsertExpressionParserTest::testParsesBooleanPredicateAndSqlStringcallsPgSqlUpsertExpressionParserTest::testParsesExcludedAndQuotedExistingReferencescallsPgSqlUpsertExpressionParserTest::testParsesPostgresExpressionCasescallsPgSqlUpsertExpressionParserTest::testRejectsMySqlQuotedIdentifiercallsPgSqlUpsertExpressionParserTest::testRejectsMySqlValuesFunctioncallsPgSqlUpsertExpressionParserTest::testUnescapesDoubledQuotesInIdentifierscalls
Called from 5
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveInsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:87
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:203
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:216
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:222
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Upsert\PgSqlUpsertExpressionParser::parseIfSupported() packages/ztd-query-postgres/src/Shadow/Mutation/Upsert/PgSqlUpsertExpressionParser.php:42
Calls 7
- new ExpressionCursor line 23
- static-call SqlTokenStream::tokenize() line 26
- static-call PgSqlLexerProfile::create() line 26
- method-call PrecedenceParser::parseOr() line 28
- new PrecedenceParser line 28
- function-call
countline 29 - new UnsupportedSqlException line 30
public function parseIfSupported(string $sql, string $tableName): ?UpsertExpressionParses the supported upsert expression subset, returning null on rejection.
Parameters
$sql | string | |
$tableName | string |
Returns
Test cases 2
Called from 2
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:202
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:215
Calls 1
- method-call PgSqlUpsertExpressionParser::parse() line 42
Test cases 13§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
PgSqlUpsertExpressionParserTest::testParseIfSupportedReturnsNullForUnsupportedFunctioncallsPgSqlUpsertExpressionParserTest::testParsesBooleanPredicateAndSqlStringcallsPgSqlUpsertExpressionParserTest::testParsesExcludedAndQuotedExistingReferencescallsPgSqlUpsertExpressionParserTest::testParsesPostgresExpressionCasescallsPgSqlUpsertExpressionParserTest::testRejectsInvalidPostgresExpressioncallsPgSqlUpsertExpressionParserTest::testRejectsMySqlQuotedIdentifiercallsPgSqlUpsertExpressionParserTest::testRejectsMySqlValuesFunctioncallsPgSqlUpsertExpressionParserTest::testUnescapesDoubledQuotesInIdentifierscalls
Other tests reaching this symbol 5
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsRowMutationResolverTestcallsPgSqlMutationResolverTestcalls
Relations§
Instantiated in 2
- new ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveInsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:75
- new ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:193
Method calls 6
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveInsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:87
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:202
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:203
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:215
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:216
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Row\RowMutationResolver::resolveUpsert() packages/ztd-query-postgres/src/Shadow/Mutation/Row/RowMutationResolver.php:222