classPartitionOption
final class PartitionOption
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One option of a partition or subpartition definition, such as ENGINE = InnoDB or COMMENT = 'text'.
Mirrors the PT_partition_option classes. Exactly one of the name, the number and the text is present, as the kind requires. The = and the STORAGE before ENGINE are optional words. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-partitioning.
$option = new \SqlSemantics\Platform\MySql\Statement\Partition\PartitionOption(\SqlSemantics\Platform\MySql\Statement\Partition\PartitionOptionKind::Comment, text: new \SqlSemantics\Platform\MySql\Statement\Literal\Text('old rows'));
$option->text?->value // => 'old rows'Properties§
public PartitionOptionKind $kindpublic Name|null $name = nullpublic Numeral|null $number = nullpublic Text|null $text = nullMethods§
public function __construct(
public PartitionOptionKind $kind,
public Name|null $name = null,
public Numeral|null $number = null,
public Text|null $text = null,
)Parameters
$kind | PartitionOptionKind | The option |
$name | Name|null | The tablespace or engine name |
$number | Numeral|null | The node group or row count |
$text | Text|null | The directory or comment |
Calls 3
- static-call Check::input() line 45
- method-call PartitionOptionKind::named() line 46
- method-call PartitionOptionKind::numbered() line 46
public function render(Output $out): voidWrites the option.
Parameters
$out | Output |
Calls 5
- method-call Output::keyword() line 56
- function-call
explodeline 56 - method-call Output::name() line 58
- class-const NameUse::Label() line 58
- method-call Output::node() line 60
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
PartitionOptionTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\OptionRule::option() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/OptionRule.php:113
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\OptionRule::option() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/OptionRule.php:116
- new SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\OptionRule::option() packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/OptionRule.php:119
Constant reads 2
- class-const SqlSemantics\Platform\MySql\Statement\Partition\PartitionDefinition::__construct() packages/sql-semantics-mysql/src/Statement/Partition/PartitionDefinition.php:51
- class-const SqlSemantics\Platform\MySql\Statement\Partition\SubpartitionDefinition::__construct() packages/sql-semantics-mysql/src/Statement/Partition/SubpartitionDefinition.php:40