final class Reindex
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

A request to rebuild indexes.

Rule: SQLITE-REINDEX-001. Without a name every index of every attached schema is rebuilt. An unqualified name is a collation name when a collation with that name is registered on the connection, otherwise a table or an index; a qualified name is a table or an index. Collations and indexes are not part of a declaration context, so the name is kept unresolved and no relation fact or diagnostic is recorded. Source: https://sqlite.org/lang_reindex.html. Status: Implemented.

Reading the target of a reindexdoctest
$reindex = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('REINDEX main.users');
    [$reindex->statement->target?->schema?->value, $reindex->statement->target?->name->value] // => ['main', 'users']

Properties§

public QualifiedName|null $target = null

Methods§

public function __construct(public QualifiedName|null $target = null)

Parameters

$targetQualifiedName|nullThe collation, table or index name; null rebuilds every index
Calls 1
public function deriveStatement(Derivation $derivation): void

Derives nothing: the kind of object the name denotes is connection state.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 3

Test cases 2§

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 1

Relations§

Instantiated in 2