sqlectron-gui icon indicating copy to clipboard operation
sqlectron-gui copied to clipboard

Remember tabs for each connection

Open gooddadmike opened this issue 7 years ago • 7 comments

One of my favorite features of MySQL Workbench is the way I can open a connection I haven't opened for months and all my last sql files/tabs are there.

This would be such a nice feature to have.

gooddadmike avatar May 17 '17 15:05 gooddadmike

I'm putting some thought into how to add this.

My first thought would be to just store it in the configuration file where the databases are stored, but that looks to be handled by core so my gut feeling is that's shared w/ the cli version.

Maybe save a new config file where it's just a JSON blob split up by server connection IDs?

Something like an array of objects, with [{ serverId: selectedServerId, queries: { ...state.queries} ]]

That'll probably get expensive writing every change to disk and state, so would probably want to debounce it, only save to disk on either tab change or query execute or sever disconnect.

Storing state.queries lets us just load up saved state though for whatever server was selected.

s-kem avatar Oct 08 '17 01:10 s-kem

The CLI has not been maintained for a long time. So, I wouldn't care about that. At least, seems it is easier to use the existing configuration file instead of handling another one.

But at the same time, that kind of transient data could grow really fast. So for that reason would be better keep it in a separated file.

Yeah, that kind of postponing would be important to not cause performance issues.

maxcnunes avatar Oct 08 '17 03:10 maxcnunes

@maxcnunes

Would you rather I add on to sqlectron.json file or create a separate file to store this data?

If the first, then I don't need to submit any changes to sqlectron-core because I can just leverage the config.save function already exposed.

If not then I'd need to submit a PR to core to expose the utils file for import into the ui.

s-kem avatar Oct 15 '17 07:10 s-kem

I believe we can start with the simplest solution by saving into the sqlectron.json. If later we find out any performance issues related to that then we can improve it by splitting it up.

maxcnunes avatar Oct 15 '17 11:10 maxcnunes

The time has come, I am starting to work on this feature 🥳

maxcnunes avatar Mar 26 '21 20:03 maxcnunes

Horay. I thought for some reason SQLectron was dead

gooddadmike avatar Mar 26 '21 22:03 gooddadmike

After a long pause I feel refreshed to continue the project back again :)

maxcnunes avatar Mar 27 '21 00:03 maxcnunes