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

HANDLER ... READ index FIRST|NEXT|PREV|LAST: reads rows of an open handler in the order of an index.

The facts follow MYSQL-HANDLER-READ-001. Source: https://dev.mysql.com/doc/refman/8.4/en/handler.html.

Reading an index read of a handlerdoctest
$read = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('HANDLER h READ idx PREV');
    [$read->statement->index->value, $read->statement->direction, $read->toString()] // => ['idx', \SqlSemantics\Platform\MySql\Statement\Dml\Handler\IndexDirection::Previous, 'HANDLER h READ idx PREV']

Properties§

public OpenHandler $handler
public Name $index
public IndexDirection $direction
public Scalar|null $where = null
public Limit|null $limit = null

Methods§

public function __construct(
    public OpenHandler $handler,
    public Name $index,
    public IndexDirection $direction,
    public Scalar|null $where = null,
    public Limit|null $limit = null,
)

Parameters

$handlerOpenHandlerThe handler read from
$indexNameThe index whose order is followed; `PRIMARY` names the primary key
$directionIndexDirectionWhich row is read
$whereScalar|nullThe condition rows must meet
$limitLimit|nullThe most rows read
public function deriveStatement(Derivation $derivation): void

Derives the handler, WHERE and LIMIT, and records the rows read.

Parameters

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

Writes the statement.

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