sqlectron-gui
sqlectron-gui copied to clipboard
Remember tabs for each connection
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.
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.
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
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.
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.
The time has come, I am starting to work on this feature 🥳
Horay. I thought for some reason SQLectron was dead
After a long pause I feel refreshed to continue the project back again :)