diff --git a/src/OrderBy/PostgresOrderByProcessor.php b/src/OrderBy/PostgresOrderByProcessor.php index 4d6ef4e..9d61738 100644 --- a/src/OrderBy/PostgresOrderByProcessor.php +++ b/src/OrderBy/PostgresOrderByProcessor.php @@ -42,6 +42,12 @@ private function processOrderBy(OrderBy $orderBy): array return ["$sortA, $sortB", array_merge($sortAArgs, $sortBArgs)]; } + if ($orderBy instanceof DocumentStore\OrderBy\DocId) { + $direction = $orderBy->direction(); + + return ["id $direction", []]; + } + /** @var DocumentStore\OrderBy\Asc|DocumentStore\OrderBy\Desc $orderBy */ $direction = $orderBy instanceof DocumentStore\OrderBy\Asc ? 'ASC' : 'DESC'; $prop = $this->propToJsonPath($orderBy->prop());