classIndexRule
final class IndexRule
Lowers CREATE INDEX and the index keys several statements share.
Rule: PG-INDEX-LOWER-001. Scope: IndexStmt, opt_unique, access_method_clause, index_params, index_elem, index_elem_options, opt_include, index_including_params, OptTableSpace, OptWhereClause. Constructors: CreateIndex, IndexElement, ColumnKey, ExpressionKey. A key written as a name is a ColumnKey; a function call or a parenthesized expression is an ExpressionKey that keeps whether the parentheses are written. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createindex.html. Status: Implemented.
Methods§
public function statement(Node $statement): CreateIndexLowers IndexStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 7
- static-call ImplementationGap::production() line 53
- new CreateIndex line 57
- method-call IndexRule::indexParameters() line 60
- method-call IndexRule::unique() line 61
- method-call IndexRule::method() line 64
- method-call IndexRule::included() line 65
- method-call IndexRule::tablespace() line 68
public function unique(Node $flag): boolLowers opt_unique.
Parameters
$flag | Node |
Returns
boolThrows
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 85
Lowers access_method_clause; none is null.
Parameters
$clause | Node |
Returns
?NameThrows
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::element() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:124
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:64
Calls 1
- static-call ImplementationGap::production() line 101
Lowers OptTableSpace; none is null.
Parameters
$clause | Node |
Returns
?NameThrows
ImplementationGap When the production has no ruleTest cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateAsRule::target() packages/sql-semantics-postgres/src/Lowering/Table/CreateAsRule.php:115
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateAsRule::materializedView() packages/sql-semantics-postgres/src/Lowering/Table/CreateAsRule.php:168
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:98
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:68
Calls 1
- static-call ImplementationGap::production() line 117
Lowers OptWhereClause; none is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::element() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:128
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::predicate() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:164
Calls 1
- static-call ImplementationGap::production() line 133
public function indexParameters(Node $list): list<IndexElement>Lowers index_params.
Parameters
$list | Node |
Returns
list<IndexElement>Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:60
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::indexParameters() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:127
Calls 2
- method-call Lowering::items() line 145
- method-call IndexRule::element() line 146
public function included(Node $clause): list<IndexElement>Lowers opt_include.
Parameters
$clause | Node |
Returns
list<IndexElement>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 3
- static-call ImplementationGap::production() line 166
- method-call Lowering::items() line 169
- method-call IndexRule::element() line 170
public function element(Node $element): IndexElementLowers index_elem with its index_elem_options.
Parameters
$element | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 2
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:177
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:178
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule::indexParameters() packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:146
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\IndexRule::included() packages/sql-semantics-postgres/src/Lowering/Table/IndexRule.php:170
Calls 4
- new ColumnKey line 185
- new ExpressionKey line 186
- static-call ImplementationGap::production() line 188
- method-call IndexRule::options() line 191
public function options(ColumnKey|ExpressionKey $key, Form $form): IndexElementLowers index_elem_options for a key.
Parameters
$key | ColumnKey|ExpressionKey | |
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 3
- new IndexElement line 205
- method-call Form::node() line 207
- static-call ImplementationGap::production() line 221
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 9
IndexRuleTest::testElementKeepsParenthesescallsIndexRuleTest::testIncludedLowersTheIncludedColumnscallsIndexRuleTest::testIndexParametersLowersEveryKeycallsIndexRuleTest::testMethodLowersTheAccessMethodcallsIndexRuleTest::testOptionsLowersTheOperatorClassParameterscallsIndexRuleTest::testPredicateIsNullWhenNotWrittencallsIndexRuleTest::testStatementLowersAnIndexWithIfNotExistscallsIndexRuleTest::testTablespaceIsNullWhenNotWrittencallsIndexRuleTest::testUniqueIsTrueForUniquecalls
Relations§
Instantiated in 9
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::element() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:124
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::element() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:128
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:173
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateAsRule::target() packages/sql-semantics-postgres/src/Lowering/Table/CreateAsRule.php:115
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateAsRule::materializedView() packages/sql-semantics-postgres/src/Lowering/Table/CreateAsRule.php:168
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:87
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::statement() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:50
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::indexParameters() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:127
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::predicate() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:164
Method calls 10
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::element() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:124
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::element() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:128
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:177
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:178
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateAsRule::target() packages/sql-semantics-postgres/src/Lowering/Table/CreateAsRule.php:115
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateAsRule::materializedView() packages/sql-semantics-postgres/src/Lowering/Table/CreateAsRule.php:168
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:98
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::statement() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:50
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::indexParameters() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:127
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::predicate() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:164