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
{{ message }}
Repository navigation
Sorting query results by click on result column title #1177
I often analyse the query results by sorting on different columns. It would be handy if I could click on a query result column header to sort the data instead of editing the query and run again. Once sorted, clicking again on same column should toggle sort direction.
That's a good idea 😄 It is going to take us a while though because we should implement a parser for SELECT statements first. The other way to solve this would be some sort of regular expression but that's more error-prone. That parser, however, will take some time and isn't a top priority right now. But I'll definitely keep this issue in mind 😄
I don't immediately see the need to parse the query. I didn't mean to rerun the query with a different ORDER BY.
Without knowing the sqlite engine, I presume sqlite will pass back a rowset in some form of an array of objects. I then could imagine running std::sort(first, last, comparerMethod) on the rowset and then redisplay the rowset.
Hmm, the problem with this is that it ignores collations and doesn't really work with our prefetching code. That's why I was thinking it's best to rerun the modified query.
Activity
MKleusberg commentedon Oct 20, 2017
That's a good idea 😄 It is going to take us a while though because we should implement a parser for SELECT statements first. The other way to solve this would be some sort of regular expression but that's more error-prone. That parser, however, will take some time and isn't a top priority right now. But I'll definitely keep this issue in mind 😄
pamtbaau commentedon Oct 20, 2017
I don't immediately see the need to parse the query. I didn't mean to rerun the query with a different ORDER BY.
Without knowing the sqlite engine, I presume sqlite will pass back a rowset in some form of an array of objects. I then could imagine running
std::sort(first, last, comparerMethod)on the rowset and then redisplay the rowset.MKleusberg commentedon Oct 20, 2017
Hmm, the problem with this is that it ignores collations and doesn't really work with our prefetching code. That's why I was thinking it's best to rerun the modified query.
chrisjlocke commentedon Oct 20, 2017
Does the table widget handle sorting natively?
It's normally (admittedly in Windows) a standard thing.
pamtbaau commentedon Oct 20, 2017
QTableWidget class does have a
sortItems(int column, Qt::SortOrder order = Qt::AscendingOrder)chrisjlocke commentedon Nov 9, 2017
So the table should be sortable like the 'browse data' table. Should be a 5 second change?
justinclift commentedon Dec 6, 2017
Might be worth a try. 😄