classColumnRule
final class ColumnRule
Lowers the elements of a table definition: column definitions, column options, column constraints and LIKE.
Rule: PG-COLUMN-LOWER-001. Scope: columnDef, columnOptions, column_compression, opt_column_compression, column_storage, opt_column_storage, ColQualList, ColConstraint, ColConstraintElem, generated_when, ConstraintAttr, opt_no_inherit, TableLikeClause, TableLikeOptionList, TableLikeOption, and the element lists of CreateTableRule. A constraint name is kept on its constraint. WITH OPTIONS in columnOptions is noise (TableNoise). Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createtable.html. Status: Implemented.
Methods§
public function elements(Node $list): list<ColumnDefinition|LikeClause|Constraint>Lowers OptTableElementList.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 4
- static-call ImplementationGap::production() line 93
- method-call Lowering::items() line 96
- method-call ColumnRule::column() line 99
- method-call ColumnRule::like() line 100
Lowers OptTypedTableElementList.
Parameters
$list | Node |
Returns
list<Clause>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::form() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:134
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::form() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:138
Calls 3
- static-call ImplementationGap::production() line 123
- method-call Lowering::items() line 126
- method-call ColumnRule::options() line 129
public function column(Node $definition): ColumnDefinitionLowers columnDef.
Parameters
$definition | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:180
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:181
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:182
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:183
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::elements() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:99
Calls 5
- static-call ImplementationGap::production() line 147
- new ColumnDefinition line 150
- method-call ColumnRule::storage() line 153
- method-call ColumnRule::compression() line 154
- method-call ColumnRule::qualifiers() line 156
public function options(Node $options): ColumnOptionsLowers columnOptions.
Parameters
$options | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 3
- new ColumnOptions line 170
- method-call ColumnRule::qualifiers() line 170
- static-call ImplementationGap::production() line 172
public function storage(Node $clause): ?ColumnStorageLowers opt_column_storage or column_storage; none is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:152
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::column() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:153
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::storage() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:186
Calls 3
- method-call ColumnRule::storage() line 186
- new ColumnStorage line 188
- static-call ImplementationGap::production() line 190
public function compression(Node $clause): ?ColumnCompressionLowers opt_column_compression or column_compression; none is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:153
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::column() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:154
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::compression() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:204
Calls 3
- method-call ColumnRule::compression() line 204
- new ColumnCompression line 206
- static-call ImplementationGap::production() line 208
Lowers ColQualList.
Parameters
$list | Node |
Returns
list<Clause>Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::column() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:156
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::options() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:170
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::options() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:171
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::columnQualifiers() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:95
Calls 5
- method-call Lowering::items() line 222
- method-call ColumnRule::constraint() line 225
- method-call ColumnRule::attribute() line 227
- new ColumnCollation line 228
- static-call ImplementationGap::production() line 229
public function constraint(Form $form, ?Name $name): ConstraintLowers ColConstraintElem with its name.
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::qualifiers() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:225
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::qualifiers() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:226
Calls 19
- new ConstraintRule line 243
- new NotNull line 247
- new NullAllowed line 248
- new ColumnUnique line 249
- method-call Form::node() line 250
- method-call ConstraintRule::tablespace() line 252
- new ColumnPrimaryKey line 255
- new ColumnCheck line 256
- method-call ColumnRule::noInherit() line 256
- new DefaultExpression line 257
- new Identity line 258
- method-call ColumnRule::when() line 258
- method-call SequenceRule::parenthesized() line 258
- new SequenceRule line 258
- new Generated line 259
- new References line 260
- method-call ConstraintRule::match() line 263
- method-call ConstraintRule::actions() line 264
- static-call ImplementationGap::production() line 267
public function when(Node $when): GeneratedWhenLowers generated_when.
Parameters
$when | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:154
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::identity() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:331
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::constraint() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:258
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\ColumnRule::constraint() packages/sql-semantics-postgres/src/Lowering/Table/ColumnRule.php:259
Calls 3
- class-const GeneratedWhen::Always() line 281
- class-const GeneratedWhen::ByDefault() line 282
- static-call ImplementationGap::production() line 283
public function attribute(Node $attribute): ConstraintAttributeLowers ConstraintAttr.
Parameters
$attribute | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 2
- class-const ColumnRule::ATTRIBUTES() line 296
- static-call ImplementationGap::production() line 296
public function noInherit(Node $flag): boolLowers opt_no_inherit.
Parameters
$flag | Node |
Returns
boolThrows
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 311
public function like(Node $clause): LikeClauseLowers TableLikeClause with its TableLikeOptionList.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleTest cases 1
Called from 1
Calls 5
- static-call ImplementationGap::production() line 324
- new LikeOption line 333
- class-const ColumnRule::LIKE() line 333
- new LikeClause line 337
- function-call
array_reverseline 337
Private surface 3§
Implementation details, listed for orientation only.
private const ATTRIBUTES = ['ConstraintAttr: DEFERRABLE' => \SqlSemantics\Platform\PostgreSql\Statement\Co…private const LIKE = ['TableLikeOption: COMMENTS' => \SqlSemantics\Platform\PostgreSql\Statement\Tab…private Lowering $loweringTest cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 12
ColumnRuleTest::testAttributeLowersInitiallyDeferredcallsColumnRuleTest::testColumnLowersTheDefinitioncallsColumnRuleTest::testCompressionLowersTheMethodcallsColumnRuleTest::testConstraintLowersAReferencecallsColumnRuleTest::testElementsLowersEveryElementcallsColumnRuleTest::testLikeKeepsTheOptionsInOrdercallsColumnRuleTest::testNoInheritIsTrueWhenWrittencallsColumnRuleTest::testOptionsDropsWithOptionscallsColumnRuleTest::testQualifiersLowersEveryQualifiercallsColumnRuleTest::testStorageIsNullForDefaultcallsColumnRuleTest::testTypedElementsLowersColumnOptionscallsColumnRuleTest::testWhenLowersByDefaultcalls
Relations§
Instantiated in 5
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:145
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:176
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::identity() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:331
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::form() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:130
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::columnQualifiers() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:95
Method calls 12
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:152
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:153
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::column() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:154
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:180
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:181
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:182
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::relation() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:183
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterCommandRule::identity() packages/sql-semantics-postgres/src/Lowering/Table/AlterCommandRule.php:331
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::form() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:133
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::form() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:134
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\CreateTableRule::form() packages/sql-semantics-postgres/src/Lowering/Table/CreateTableRule.php:138
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Table\Tables::columnQualifiers() packages/sql-semantics-postgres/src/Lowering/Table/Tables.php:95