Closed lostman closed 11 months ago
After looking at the examples @ra0x3 added to the release notes:
https://github.com/FuelLabs/fuel-indexer/releases/tag/v0.24.0
I realized the implementation of order_by doesn't match the SQL.
order_by
The desired DSL should look like this:
let found_order = Order::find( Order::amount() .gt(order.amount) .and(Order::address().eq(0x001)) .order_by(Order::time().asc()), );
Meanwhile, the current implementation is like this:
let found_order = Order::find( Order::amount() .gt(order.amount) .and(Order::address().eq(0x001)) .order_by(Order::time()).asc(), );
Furthermore, the results can currently be ordered only by a single field.
I will update the DSL to match SQL, and add an ordering by multiple fields:
let found_order = Order::find( Order::amount() .gt(order.amount) .and(Order::address().eq(0x001)) .order_by((Order::time(), Order::amount().desc())), );
Issue
After looking at the examples @ra0x3 added to the release notes:
https://github.com/FuelLabs/fuel-indexer/releases/tag/v0.24.0
I realized the implementation of
order_by
doesn't match the SQL.The desired DSL should look like this:
Meanwhile, the current implementation is like this:
Furthermore, the results can currently be ordered only by a single field.
I will update the DSL to match SQL, and add an ordering by multiple fields: