final class PartitionBy
    implements TrailingCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

PARTITION BY … in ALTER TABLE: a request to partition or repartition the table.

Mirrors PT_alter_table_partition_by. The partitioning is derived in the scope of the changed table (MYSQL-PARTITIONING-001). Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table-partition-operations.html.

Partitioning a table by hashdoctest
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t PARTITION BY HASH (a) PARTITIONS 4');
    $alter->toString() // => 'ALTER TABLE t PARTITION BY HASH (a) PARTITIONS 4'

Properties§

public PartitionClause $partitioning

Methods§

public function __construct(public PartitionClause $partitioning)

Parameters

$partitioningPartitionClauseThe new partitioning
public function deriveCommand(Derivation $derivation, Environment $scope): void

Derives the partitioning in the scope of the table.

Parameters

$derivationDerivation
$scopeEnvironment
Calls 1
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 1

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