final class AttributeRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

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

$loweringLoweringThe lowering this rule belongs to
public function marks(Form $form): void

Confirms the keyword rules inside a keyword attribute: not and opt_primary.

Parameters

$formForm

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
public function value(Node $value): Scalar

Lowers the value of a literal default: a node of now_or_signed_literal.

Parameters

$valueNode

Returns

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 1
public function collation(Node $name): CollationName

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 $lowering

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5

Relations§

Instantiated in 1
Method calls 1