Skip to content

Sorting query results by click on result column title #1177

Open

Description

@pamtbaau

Details for the issue

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.

Useful extra information

I'm opening this issue because:

  • DB4S is crashing
  • DB4S has a bug
  • DB4S needs a feature
  • DB4S has another problem

I'm using DB4S on:

  • Windows: ( version: 10 )
  • Linux: ( distro: ___ )
  • Mac OS: ( version: ___ )
  • Other: ___

I'm using DB4S version:

  • 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: ___

I have also:

Activity

  1. MKleusberg commented on Oct 20, 2017

    @MKleusberg
    Member

    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 😄

  2. pamtbaau commented on Oct 20, 2017

    @pamtbaau
    Author

    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.

  3. MKleusberg commented on Oct 20, 2017

    @MKleusberg
    Member

    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.

  4. chrisjlocke commented on Oct 20, 2017

    @chrisjlocke
    Member

    Does the table widget handle sorting natively?
    It's normally (admittedly in Windows) a standard thing.

  5. pamtbaau commented on Oct 20, 2017

    @pamtbaau
    Author

    QTableWidget class does have a sortItems(int column, Qt::SortOrder order = Qt::AscendingOrder)

  6. chrisjlocke commented on Nov 9, 2017

    @chrisjlocke
    Member

    So the table should be sortable like the 'browse data' table. Should be a 5 second change?

  7. justinclift commented on Dec 6, 2017

    @justinclift
    Member

    Might be worth a try. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions