classAttributeRule
final class AttributeRule
Lowers the attributes of a column definition.
Rule: MYSQL-COLUMN-ATTRIBUTE-001. Scope: attribute (5.x), gcol_attribute (5.7), column_attribute (8.0 and later), column_format, storage_media, now_or_signed_literal, opt_primary. KEY alone is PRIMARY KEY and UNIQUE KEY is UNIQUE (create-table.html: "KEY, when used alone in a column
- definition, is a synonym for PRIMARY KEY"; "UNIQUE [KEY]"). Constructs:
the ColumnAttribute classes and CheckConstraint. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function attribute(Node $attribute): ColumnAttributeLowers one attribute: a node of attribute, gcol_attribute or column_attribute.
Parameters
$attribute | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 2
Called from 2
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\Column\AttributeRule::valued() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Column/AttributeRule.php:119
- method-call SqlSemantics\Platform\MySql\Lowering\TableDefinition\Column\ColumnRule::attributes() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Column/ColumnRule.php:140
Calls 7
- class-const AttributeRule::KEYWORDS() line 90
- method-call AttributeRule::marks() line 92
- new KeywordAttribute line 94
- class-const AttributeRule::FORMATS() line 96
- new FormatAttribute line 98
- new StorageAttribute line 98
- method-call AttributeRule::valued() line 101
public function valued(Form $form): ColumnAttributeLowers an attribute that holds a value.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 23
- new DefaultLiteral line 114
- method-call AttributeRule::value() line 114
- method-call Form::node() line 114
- new DefaultExpression line 115
- new OnUpdate line 116
- new CommentAttribute line 117
- new CollateAttribute line 118
- method-call AttributeRule::collation() line 118
- method-call AttributeRule::attribute() line 119
- new SridAttribute line 120
- new CheckConstraint line 121
- method-call KeyRule::check() line 121
- new KeyRule line 121
- method-call KeyRule::constraint() line 121
- new EnforcementAttribute line 122
- method-call KeyRule::enforced() line 122
- new EngineAttribute line 123
- new KeywordAttribute line 125
- method-call KeyOptionRule::visible() line 125
- new KeyOptionRule line 125
- class-const ColumnKeyword::Visible() line 125
- class-const ColumnKeyword::Invisible() line 125
- static-call ImplementationGap::production() line 126
public function marks(Form $form): voidConfirms the keyword rules inside a keyword attribute: not and opt_primary.
Parameters
$form | Form |
Throws
ImplementationGap When a production has no ruleTest cases 1
Lowers the value of a literal default: a node of now_or_signed_literal.
Parameters
$value | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 1
- static-call ImplementationGap::production() line 160
public function collation(Node $name): CollationNameLowers a collation name that must be present.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 1
- static-call Check::invariant() line 172
Private surface 3§
Implementation details, listed for orientation only.
private const KEYWORDS = ['attribute: NULL_SYM' => \SqlSemantics\Platform\MySql\Statement\Table\Column\K…private const FORMATS = ['attribute: COLUMN_FORMAT_SYM DEFAULT' => \SqlSemantics\Platform\MySql\Stateme…private Lowering $loweringTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.