classPgSqlPartitionParser
final class PgSqlPartitionParser
Partition parser for PostgreSQL queries.
Methods§
public function parseKey(string $sql): ?TablePartitionKeyReads a CREATE TABLE partition strategy and its key expressions.
Parameters
$sql | string |
Returns
Test cases 5
PgSqlPartitionParserTest::testIgnoresNestedPartitionKeywordsWhenFindingTopLevelClausescallsPgSqlPartitionParserTest::testParentTableRejectsMalformedPartitionClausescallsPgSqlPartitionParserTest::testParseKeyParsesRangePartitionKeyAndBoundscallsPgSqlPartitionParserTest::testParsesAllKeyStrategiescallsPgSqlPartitionParserTest::testSkipsIncompleteKeywordPairBeforeThePartitionClausecalls
Called from 3
- method-call ZtdQuery\Platform\Postgres\Schema\Definition\TableFields::definition() packages/ztd-query-postgres/src/Schema/Definition/TableFields.php:146
- method-call ZtdQuery\Platform\Postgres\Schema\Reflection\Catalog\PartitionKeys::reflect() packages/ztd-query-postgres/src/Schema/Reflection/Catalog/PartitionKeys.php:47
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Table\TableMutationResolver::resolvePartition() packages/ztd-query-postgres/src/Shadow/Mutation/Table/TableMutationResolver.php:153
Calls 11
- static-call SqlTokenStream::tokenize() line 24
- static-call PgSqlLexerProfile::create() line 24
- method-call ClauseTokens::keywordPairIndex() line 26
- new ClauseTokens line 26
- class-const TablePartitionStrategy::Range() line 36
- class-const TablePartitionStrategy::List() line 37
- class-const TablePartitionStrategy::Hash() line 38
- method-call ClauseTokens::closingParenthesisIndex() line 46
- function-call
substrline 52 - function-call
in_arrayline 54 - new TablePartitionKey line 58
public function parentTable(string $sql): ?stringReturns the parent relation named in a PARTITION OF clause.
Parameters
$sql | string |
Returns
?stringTest cases 2
Called from 1
Calls 5
- static-call SqlTokenStream::tokenize() line 66
- static-call PgSqlLexerProfile::create() line 66
- method-call ClauseTokens::keywordPairIndex() line 68
- new ClauseTokens line 68
- method-call ClauseTokens::qualifiedIdentifierAt() line 73
public function parseRelation(
string $sql,
TablePartitionKey $parentKey,
): ?TablePartitionRelationResolves a child partition and its predicate using the parent partition key.
Parameters
$sql | string | |
$parentKey | TablePartitionKey |
Returns
Test cases 10
PgSqlPartitionParserTest::testIgnoresNestedPartitionKeywordsWhenFindingTopLevelClausescallsPgSqlPartitionParserTest::testListPredicatesDistinguishValuesNullAndWhitespacecallsPgSqlPartitionParserTest::testParentTableRejectsMalformedPartitionClausescallsPgSqlPartitionParserTest::testParseKeyParsesRangePartitionKeyAndBoundscallsPgSqlPartitionParserTest::testParseRelationParsesListPartitionIncludingNullcallsPgSqlPartitionParserTest::testParsesDefaultPartitioncallsPgSqlPartitionParserTest::testParsesFiniteMultiColumnRangeAsRowComparisoncallsPgSqlPartitionParserTest::testParsesUnboundedRangecallsPgSqlPartitionParserTest::testRejectsHashAndMixedUnboundedRangeInsteadOfGuessingcallsPgSqlPartitionParserTest::testRejectsMalformedBoundsIndependentlycalls
Called from 1
Calls 13
- static-call SqlTokenStream::tokenize() line 81
- static-call PgSqlLexerProfile::create() line 81
- method-call ClauseTokens::keywordPairIndex() line 83
- new ClauseTokens line 83
- method-call ClauseTokens::qualifiedIdentifierAt() line 87
- method-call ClauseTokens::keywordIndex() line 92
- new TablePartitionRelation line 95
- class-const TablePartitionStrategy::Range() line 102
- method-call BoundPredicate::rangePredicate() line 102
- new BoundPredicate line 102
- class-const TablePartitionStrategy::List() line 103
- method-call BoundPredicate::listPredicate() line 103
- class-const TablePartitionStrategy::Hash() line 104
Test cases 29§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 13
PgSqlPartitionParserTest::testIgnoresNestedPartitionKeywordsWhenFindingTopLevelClausescallsPgSqlPartitionParserTest::testListPredicatesDistinguishValuesNullAndWhitespacecallsPgSqlPartitionParserTest::testNormalizesUnquotedParentNamesAndPreservesQuotedNamescallsPgSqlPartitionParserTest::testParentTableRejectsMalformedPartitionClausescallsPgSqlPartitionParserTest::testParseKeyParsesRangePartitionKeyAndBoundscallsPgSqlPartitionParserTest::testParseRelationParsesListPartitionIncludingNullcallsPgSqlPartitionParserTest::testParsesAllKeyStrategiescallsPgSqlPartitionParserTest::testParsesDefaultPartitioncallsPgSqlPartitionParserTest::testParsesFiniteMultiColumnRangeAsRowComparisoncallsPgSqlPartitionParserTest::testParsesUnboundedRangecallsPgSqlPartitionParserTest::testRejectsHashAndMixedUnboundedRangeInsteadOfGuessingcallsPgSqlPartitionParserTest::testRejectsMalformedBoundsIndependentlycallsPgSqlPartitionParserTest::testSkipsIncompleteKeywordPairBeforeThePartitionClausecalls
Other tests reaching this symbol 16
PgSqlSessionFactoryTestcallsTableContextTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsTableFieldsTestcallsPgSqlPartitionReflectorTestcallsPgSqlSchemaParserTestcallsPgSqlSchemaReflectorTestcallsPartitionKeysTestcallsSchemaInitializerTestcallsRowMutationResolverTestcallsTableMutationResolverTest::testResolveAlterTableRejectsUnsupportedSchemaChangescallsTableMutationResolverTest::testResolveCreateTableRegistersItsSchemaOnlyWhenAppliedcallsTableMutationResolverTest::testResolveDropTableRemovesOnlyTheTargetcallsTableMutationResolverTest::testResolvePartitionInheritsItsParentDefinitioncallsPgSqlMutationResolverTestcalls
Relations§
Instantiated in 3
- new ZtdQuery\Platform\Postgres\Schema\Definition\TableFields::definition() packages/ztd-query-postgres/src/Schema/Definition/TableFields.php:146
- new ZtdQuery\Platform\Postgres\Schema\Reflection\Catalog\PartitionKeys::reflect() packages/ztd-query-postgres/src/Schema/Reflection/Catalog/PartitionKeys.php:31
- new ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver::__construct() packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:41
Method calls 5
- method-call ZtdQuery\Platform\Postgres\Schema\Definition\TableFields::definition() packages/ztd-query-postgres/src/Schema/Definition/TableFields.php:146
- method-call ZtdQuery\Platform\Postgres\Schema\Reflection\Catalog\PartitionKeys::reflect() packages/ztd-query-postgres/src/Schema/Reflection/Catalog/PartitionKeys.php:47
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Table\TableMutationResolver::resolveCreateTable() packages/ztd-query-postgres/src/Shadow/Mutation/Table/TableMutationResolver.php:62
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Table\TableMutationResolver::resolvePartition() packages/ztd-query-postgres/src/Shadow/Mutation/Table/TableMutationResolver.php:147
- method-call ZtdQuery\Platform\Postgres\Shadow\Mutation\Table\TableMutationResolver::resolvePartition() packages/ztd-query-postgres/src/Shadow/Mutation/Table/TableMutationResolver.php:153
Type declarations 3
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Table\TableMutationResolver packages/ztd-query-postgres/src/Shadow/Mutation/Table/TableMutationResolver.php:29
- type ZtdQuery\Platform\Postgres\Shadow\Mutation\Table\TableMutationResolver packages/ztd-query-postgres/src/Shadow/Mutation/Table/TableMutationResolver.php:36
- type ZtdQuery\Platform\Postgres\Shadow\PgSqlMutationResolver packages/ztd-query-postgres/src/Shadow/PgSqlMutationResolver.php:26