* order by * update sql
@ -188,6 +188,7 @@ export class SearchRepository implements ISearchRepository {
.addCommonTableExpression(cte, 'cte')
.from('cte', 'res')
.where('res.distance <= :maxDistance', { maxDistance })
.orderBy('res.distance')
.getRawMany();
});
return results.map((row) => ({
@ -229,6 +229,8 @@ FROM
"cte" "res"
WHERE
res.distance <= $3
ORDER BY
res.distance ASC
COMMIT
-- SearchRepository.searchPlaces