You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the params object being placed as data types into the query, so a string is enclosed in quotes. Hence the necessary keywords ASC or DESC 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 and DESC also true and false? Alternatively the sort direction could be controlled by a top-level parameter like limit, but this would then be not SQL specific and maybe expected to work with all languages.
wget -qO- --content-on-error "http://localhost:2480/api/v1/query/test" --post-data='{"language": "sql", "params": { "dir": "asc" }, "command": "SELECT num FROM Test ORDER BY num :dir"}' --user=root --password=password
The text was updated successfully, but these errors were encountered:
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 the
params
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
The text was updated successfully, but these errors were encountered: