final class Reorder
    implements AlterCommand
    uses Snapshot
Public API: explicitly declared with @visibility public.

ORDER BY column [ASC | DESC], …: a request to store the rows in an order once, when the table is rebuilt.

Mirrors PT_alter_table_order. Each item names a column of the table (the grammar admits only column names) and is resolved in the scope of the changed table. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-order-by.

Ordering the rows by a columndoctest
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t ORDER BY a DESC');
    $alter->toString() // => 'ALTER TABLE t ORDER BY a DESC'

Properties§

public list<OrderItem> $items

Methods§

public function __construct(list<OrderItem> $items)

Parameters

$itemslist<OrderItem>The ordering columns in order; at least one
Calls 3
public function deriveCommand(Derivation $derivation, Environment $scope): void

Resolves the ordering columns in the scope of the table.

Parameters

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

Writes the action.

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