packages/sql-semantics-mysql/src/Statement/Dml/Handler/IndexDirection.php

1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics\Platform\MySql\Statement\Dml\Handler;
6
7/**
8 * Which row HANDLER ... READ index FIRST|NEXT|PREV|LAST fetches in index order.
9 *
10 * Each case holds the keyword it is written with.
11 * Source: https://dev.mysql.com/doc/refman/8.4/en/handler.html.
12 *
13 * @visibility public
14 * @example Reading the keyword of a case
15 *     \SqlSemantics\Platform\MySql\Statement\Dml\Handler\IndexDirection::Previous->value // => 'PREV'
16 */
17enum IndexDirection: string
18{
19    case First = 'FIRST';
20    case Next = 'NEXT';
21    case Previous = 'PREV';
22    case Last = 'LAST';
23}
24