Open gramian opened 3 days ago
The necessary changes look rather easy, every:
[ <DESC> { lastItem.type = OrderByItem.DESC; }| <ASC> { lastItem.type = OrderByItem.ASC; }]
would become
[ (<DESC>|<FALSE>) { lastItem.type = OrderByItem.DESC; }| (<ASC>|<TRUE>) { lastItem.type = OrderByItem.ASC; }]
And could be read as "use default direction? true / false".
ArcadeDB Version:
ArcadeDB Server v24.11.1 (build b466f487e42fbb39fd20965004ce88682335eaba/1730841732933/main)
OS and JDK Version:
Running on Linux 6.2.0-26-generic - OpenJDK 64-Bit Server VM 17.0.13
It is currently not possible to set the direction of sorting of
ORDER BY
via parameter (ie HTTP API,params
object). I think this is due to the parameters in theparams
object being placed as data types into the query, so a string is enclosed in quotes. Hence the necessary keywordsASC
orDESC
cannot be set, as using a parameter would result in the strings"ASC"
or"DESC"
.To allow control somewhat safely without allowing keywords to be passed, the grammar could allow in addition to
ASC
andDESC
alsotrue
andfalse
? Alternatively the sort direction could be controlled by a top-level parameter likelimit
, but this would then be not SQL specific and maybe expected to work with all languages.@lvca WDYT?
Steps to reproduce