| Author |
Message |
vesper8
knows MySQLDumper

Joined: 12 Feb 2010
Posts: 3

|
Posted:
2010-02-12, 21:51 is there a way to set default sorting? |
  |
Hi there!
I love this program and it is so useful.
I have just one little quirk.. when I am editing entries in my tables.. I want to see the latest entries first and I always have to sort by ID, click "ID" once.. and then it sorts ASC.. and then click again to go DESC.
It would be great if I could make the default ordering of all my tables to show me the latest entries first (so ORDER BY <primary key> DESC) by default.
|
|
  |
 |
Anzeigen
|
Posted:
Anzeigen |
 |
|
| |
 |
DSB
Developer


Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg

|
Posted:
2010-02-12, 22:26 Re: is there a way to set default sorting? |
  |
Hi vesper8,
« vesper8 » wrote: It would be great if I could make the default ordering of all my tables to show me the latest entries first (so ORDER BY <primary key> DESC) by default.
Good suggestion!
If no Order-Statement is given, get the primary key of the table and sort it descending, so the latest entries are at the top of the list. This is exactly the way I would like to act MySQLDumper myself. I just can't understand why I didn't have that idea myself.
While I am totally re-coding the SQLBrowser at the moment, you've hit the right time for your suggestion. I will try to implement that in the next version.
Btw: I've moved this to "Feature Requests".
_________________ Gruß / Greetings, DSB
Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.
|
|
    |
 |
vesper8
knows MySQLDumper

Joined: 12 Feb 2010
Posts: 3

|
Posted:
2010-02-12, 22:29 (No subject) |
  |
That's great! I'm glad I could help.
Keep up the fantastic work!
|
|
  |
 |
DSB
Developer


Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg

|
Posted:
2010-02-12, 22:32 (No subject) |
  |
Of course we will.
I placed your suggestion on our internal todo-list. So we won't forget about it.
_________________ Gruß / Greetings, DSB
Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.
|
|
    |
 |
DSB
Developer


Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg

|
Posted:
2010-02-12, 22:39 (No subject) |
  |
You could save one click in version 1.24 stable if you edit the file sql.php and change line 55 from
$orderdir=(!isset($_GET['orderdir'])) ? '' : $_GET['orderdir'];
to
$orderdir=(!isset($_GET['orderdir'])) ? 'DESC' : $_GET['orderdir'];
This way a row is sorted descending the first click you hit it.
_________________ Gruß / Greetings, DSB
Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.
Last edited by DSB on 2010-02-12, 22:41; edited 1 time in total
|
|
    |
 |
vesper8
knows MySQLDumper

Joined: 12 Feb 2010
Posts: 3

|
Posted:
2010-02-12, 22:41 (No subject) |
  |
Cool! I'll try that.
You know.. since ALL of my tables always systematically have a primary key column called "ID". I bet I could also modify a line in the sql.php so it starts off with ORDER BY ID DESC automatically.
Would you happen to know which line that would be?
|
|
  |
 |
DSB
Developer


Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg

|
Posted:
2010-02-12, 22:45 (No subject) |
  |
« vesper8 » wrote: Would you happen to know which line that would be?
This would be some extra coding. You'll first have to analyze the table if it has got a primary key and which and create the ORDER BY-Statement from that information.
Up to now there is no such thing and so it is not done by changing one line.
As I mentioned above I am on my way to totally re-code the SQLBrowser and will keep your suggestion in mind while doing that.
_________________ Gruß / Greetings, DSB
Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.
Last edited by DSB on 2010-02-12, 22:53; edited 2 times in total
|
|
    |
 |
DSB
Developer


Age: 41
Joined: 30 Apr 2004
Posts: 16070
Location: Reichenberg bei Würzburg

|
Posted:
2010-02-12, 22:47 (No subject) |
  |
« vesper8 » wrote: I bet I could also modify a line in the sql.php so it starts off with ORDER BY ID DESC automatically.
Would you happen to know which line that would be?
For your private purposes you could take a look at line 56 and replace '' with 'id'
But this is not a solution I could implement for all users of MySQLDumper, because this will throw errors if a table doesn't have a row called "id".
_________________ Gruß / Greetings, DSB
Teigwaren heißen Teigwaren, weil sie Teig waren.
Diejenigen, die lautstark darüber diskutieren, warum es nicht geht, mögen bitte jene nicht stören, die es gerade tun.
|
|
    |
 |
|
|