classKeywordAttribute
final class KeywordAttribute
implements ColumnAttribute
uses Snapshot
Public API: explicitly declared with
@visibility public.A column attribute written as keywords alone, such as NOT NULL, AUTO_INCREMENT, PRIMARY KEY or INVISIBLE.
KEY alone means PRIMARY KEY and UNIQUE KEY means UNIQUE; the attribute is written in the full form and the short form respectively. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html.
(new \SqlSemantics\Platform\MySql\Statement\Table\Column\KeywordAttribute(\SqlSemantics\Platform\MySql\Statement\Table\Column\Kind\ColumnKeyword::AutoIncrement))->keyword->value // => 'AUTO_INCREMENT'Properties§
public ColumnKeyword $keywordMethods§
public function __construct(public ColumnKeyword $keyword)Parameters
$keyword | ColumnKeyword | The attribute |
public function deriveAttribute(Derivation $derivation, Environment $scope): voidDerives nothing: the attribute holds no expression.
Parameters
$derivation | Derivation | |
$scope | Environment |
public function render(Output $out): voidWrites the keywords.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 47
- function-call
explodeline 47
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 3
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\Column\AttributeRule::attribute() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Column/AttributeRule.php:94
- new SqlSemantics\Platform\MySql\Lowering\TableDefinition\Column\AttributeRule::valued() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Column/AttributeRule.php:125
Type checks 3
- instanceof SqlSemantics\Platform\MySql\Lowering\TableDefinition\Column\ColumnRule::refuse() packages/sql-semantics-mysql/src/Lowering/TableDefinition/Column/ColumnRule.php:160
- instanceof SqlSemantics\Platform\MySql\Rules\TableDefinition\ColumnFlags::flags() packages/sql-semantics-mysql/src/Rules/TableDefinition/ColumnFlags.php:56
- instanceof SqlSemantics\Platform\MySql\Rules\TableDefinition\ColumnFlags::invisible() packages/sql-semantics-mysql/src/Rules/TableDefinition/ColumnFlags.php:91