final class PartitionDefinition
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

PARTITION name [VALUES …] [options] [(subpartitions)]: one partition of a partitioned table.

Mirrors PT_part_definition. RANGE and LIST partitions state their values; KEY and HASH partitions state none. An empty subpartition list means none is written. Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-partitioning.

Holding a range partitiondoctest
$partition = new \SqlSemantics\Platform\MySql\Statement\Partition\PartitionDefinition(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('p0'), new \SqlSemantics\Platform\MySql\Statement\Partition\Bound\LessThan(null), [], []);
    [$partition->name->value, $partition->values?->row] // => ['p0', null]

Properties§

public list<PartitionOption> $options
public list<SubpartitionDefinition> $subpartitions
public Name $name
public PartitionBound|null $values

Methods§

public function __construct(
    public Name $name,
    public PartitionBound|null $values,
    list<PartitionOption> $options,
    list<SubpartitionDefinition> $subpartitions,
)

Parameters

$nameNameThe partition name
$valuesPartitionBound|nullThe partition values, when written
$optionslist<PartitionOption>The options in order
$subpartitionslist<SubpartitionDefinition>The subpartitions in order
Calls 3
public function derivePartition(Derivation $derivation): void

Derives the partition values as constants.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the definition.

Parameters

$outOutput
Calls 4

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Constant reads 3
Type declarations 1