final class AlgorithmOption
    implements AlterOption, AlterModifier
    uses Snapshot
Public API: explicitly declared with @visibility public.

ALGORITHM [=] DEFAULT | name: the algorithm the server must use for a table change.

The grammar reads the algorithm as an identifier; the server accepts INPLACE and COPY, INSTANT from 8.0 on, and the word DEFAULT spelled as an identifier in 5.6 and 5.7, compared without regard to case. Any other name is the diagnostic UnknownAlterChoice (MYSQL-ALTER-CHOICES-001). The name is kept as written; the keyword DEFAULT is the absent name. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-table.html#alter-table-performance.

Requesting an in-place changedoctest
$option = new \SqlSemantics\Platform\MySql\Statement\Alter\Modifier\AlgorithmOption(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('INPLACE'));
    $option->algorithm?->value // => 'INPLACE'

Properties§

public Name|null $algorithm

Methods§

public function __construct(public Name|null $algorithm)

Parameters

$algorithmName|nullThe algorithm name, or null for the keyword DEFAULT
public function deriveOption(Derivation $derivation): void
public function deriveCommand(Derivation $derivation, Environment $scope): void

Derives the option as an action of ALTER TABLE.

Parameters

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

Writes the option.

Parameters

$outOutput
Calls 3

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
Type declarations 1