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

ALTER INDEX i VISIBLE | INVISIBLE (8.0 and later): a request to make an index visible to or hidden from the optimizer.

Mirrors PT_alter_table_index_visible. Source: https://dev.mysql.com/doc/refman/8.4/en/invisible-indexes.html.

Hiding an indexdoctest
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER TABLE t ALTER INDEX i INVISIBLE');
    $alter->statement->commands[0]->visible // => false

Properties§

public Name $index
public bool $visible

Methods§

public function __construct(public Name $index, public bool $visible)

Parameters

$indexNameThe index name
$visibleboolWhether VISIBLE (true) or INVISIBLE (false) is written
public function deriveCommand(Derivation $derivation, Environment $scope): void

Derives nothing: the action holds no expression.

Parameters

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

Writes the action.

Parameters

$outOutput
Calls 2

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