alash3al/sqler

result column order is not respected

Chaz6 opened this issue · 2 comments

Chaz6 commented

In my sqler.hcl is the stanza

logins {
    methods = ["GET"]
    exec = "SELECT id,user,pass,source,time FROM logins ORDER BY id DESC LIMIT 50;"
}

however the resulting json has the columns in alphabetical order:-

id, pass, source, time, user

because the column ordering isn't important, it will return an object for each row, so where is the problem when you know that the id column is id, and so?

Chaz6 commented

When I am viewing the output (either directly or transformed), I want to see the order I specify because it is hard for me when the columns are unordered. Not all tools allow you to re-order columns. I would prefer that the source output them in the order I specify.