Enable re-sequencing of connections

HerrimanCoder's profile image HerrimanCoder posted 5 months ago in Feature discussion Permalink

I have many connections in my HeidiSQL 12.7. I want to be able to resequence them as follows:

  1. Localhost at the top
  2. Most important/active connections next
  3. Infrequently-used connections at the bottom

It seems that in the past there was a Heidi ini or config file that could be edited in order to accomplish this, but I cannot find that file anywhere.

Is there any way to do this? Could functionality be added that would allow me to resequence my connections?

ansgar's profile image ansgar posted 5 months ago Permalink

HeidiSQL's configuration is stored in your registry, but that does not allow some hack for sorting here.

The only way to sort sessions is to click on one of the column headers. Note you can show/hide columns by rightclick on the header.

Description

One way to create a custom order is the "Comment" field. You can store any text in it (see tab "Settings"). And if comments are "a", "b", "c" etc. and then click on the comment header, this might be what you want.

You may also create folders (see buttons at the bottom). You can still use the column headers to sort these:

Description

HerrimanCoder's profile image HerrimanCoder posted 5 months ago Permalink

Thanks ansgar, but I'm confused because my connection list looks very different from yours, and there is now Comment column. See attachment.

1 attachment(s):
  • connections
HerrimanCoder's profile image HerrimanCoder posted 5 months ago Permalink

Sorry, I meant to say "there is no Comment column".

ansgar's profile image ansgar posted 5 months ago Permalink

Your screenshot shows the main window, with already connected sessions. I thought you were referring to the session manager, didn't you?

Probably you have activated automatic connecting at startup. With these many connections, I would recommend disabling auto-connect, and instead using the session manager.

Description

HerrimanCoder's profile image HerrimanCoder posted 5 months ago Permalink

Thanks, I made that pref change. It is a tiny bit better now, but also not great. I would like to propose that you provide a way to sort my connections according to my preference. It doesn't have to be a fancy UI thing; I'm happy to edit an xml/ini/config/txt file of some kind to accomplish it.

Thanks for your assistance.

ansgar's profile image ansgar posted 5 months ago Permalink

Thanks, I made that pref change. It is a tiny bit better now, but also not great.

Does that mean we are still talking about the main window, not the session manager? I'm confused.

HerrimanCoder's profile image HerrimanCoder posted 5 months ago Permalink

Apologies for my ambiguity. When I unchecked "Automatically reconnect...", it forces me to use the session manager, and reduces the clutter. I can then achieve the sort order I want, and many fewer connections. This is OK. My preference though, if I could make a wish, would be to continue using "previously opened sessions" so I don't have to reconnect multiple times...but then have an easy way to resequence those connections and have them persist in the order I like, even if it's just a config/xml/ini file or something.

Thank you.

ansgar's profile image ansgar posted 4 months ago Permalink

Well, if you once connect to the sessions in your wanted sorting order, HeidiSQL should reopen them in the same order the next time (if the auto-connect at startup is active). Or is the order of connections different after reopening?

In the session manager, we have a very different approach. There is issue #1935 where I will probably provide a sorting order defined by the user per drag'n drop. But as you prefer the auto-connect option, that's likely not what you want.

HerrimanCoder's profile image HerrimanCoder posted 4 months ago Permalink

Yes I was hoping for (1) Autoconnect and (2) Sort order as per my saved preference.

Thank you.

ansgar's profile image ansgar posted 4 months ago Permalink

As asked above, is the order of connections different after reopening?

HerrimanCoder's profile image HerrimanCoder posted 4 months ago Permalink

Sorry ansgar for missing that, and for my delay. After closing Heidi and reopening, the sequence of connections within Connection Manager are identical compared to before closing the app.

So this brings up an interesting possibility. It's clear that you're persisting that sequence somewhere. Maybe in the registry or a file. It's also clear that when auto-connect at startup is active, you're also persisting the sequence of those connections, since they reopen in the identical sequence every time.

If you could tell me where/how those are persisted, I would be happy to manually resequence according to my desire. I don't care if it takes me half an hour, I would be so happy to have my chosen sequence forever after.

And if you don't feel like building resequence functionality, I could pretty easily build a little script or app that people (if anyone else cares) could run and easily change the sequence.

Can you tell me where/how the "auto-connect connections" are stored, so I can go in and hack it to my needs?

ansgar's profile image ansgar posted 4 months ago Permalink

Normally, you would open up your sessions in the order they should appear in the tree.

But yes, there is a registry value where the last session names are stored, delimited by pipe "|" :

HKEY_CURRENT_USER\Software\HeidiSQL\LastSessions

HerrimanCoder's profile image HerrimanCoder posted 4 months ago Permalink

ansgar, that is perfect. I can work with that. Thank you!

Please login to leave a reply, or register at first.