classHandlerIndexRead
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.
$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 $handlerpublic Name $indexpublic IndexDirection $directionpublic Scalar|null $where = nullpublic Limit|null $limit = nullMethods§
public function __construct(
public OpenHandler $handler,
public Name $index,
public IndexDirection $direction,
public Scalar|null $where = null,
public Limit|null $limit = null,
)Parameters
$handler | OpenHandler | The handler read from |
$index | Name | The index whose order is followed; `PRIMARY` names the primary key |
$direction | IndexDirection | Which row is read |
$where | Scalar|null | The condition rows must meet |
$limit | Limit|null | The most rows read |
public function deriveStatement(Derivation $derivation): voidDerives the handler, WHERE and LIMIT, and records the rows read.
Parameters
$derivation | Derivation |
Calls 2
- method-call HandlerFacts::read() line 48
- new HandlerFacts line 48
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 56
- class-const NameUse::Label() line 56
- method-call Output::node() line 60
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
HandlerIndexReadTestcalls