final class PartitionClause
    implements Partitioning
    uses Snapshot
Public API: explicitly declared with @visibility public.

PARTITION BY method [PARTITIONS n] [SUBPARTITION BY …] [(definitions)]: how a table is partitioned.

Mirrors PT_partition. Rule: MYSQL-PARTITIONING-001. The partitioning function and the partitioning columns are derived in the scope of the partitioned table, which the statement holding the clause provides: an expression gets the facts of its column references, a column name the completely known table does not have is the diagnostic UnknownColumn. The partition values are constants and see no column. An empty definition list means none is written. Terminates: one pass over the definitions. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning.html, https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-partitioning. Status: Implemented.

Holding a hash partitioning into four partitionsdoctest
$clause = new \SqlSemantics\Platform\MySql\Statement\Partition\PartitionClause(new \SqlSemantics\Platform\MySql\Statement\Partition\Method\KeyMethod(false, null, []), new \SqlSemantics\Platform\MySql\Statement\Literal\Numeral('4'), null, []);
    $clause->partitions?->text // => '4'

Properties§

public list<PartitionDefinition> $definitions
public Numeral|null $partitions
public Subpartitioning|null $subpartitioning

Methods§

public function __construct(
    public PartitionMethod $method,
    public Numeral|null $partitions,
    public Subpartitioning|null $subpartitioning,
    list<PartitionDefinition> $definitions,
)

Parameters

$methodPartitionMethodThe partitioning method
$partitionsNumeral|nullThe PARTITIONS count, when written
$subpartitioningSubpartitioning|nullThe subpartitioning, when written
$definitionslist<PartitionDefinition>The partition definitions in order
Calls 2
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 3

Test cases 3§

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 2

Relations§

Instantiated in 1
Method calls 2
Type declarations 5