-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: (add option) restore unsaved queries #140
Comments
additionally it would be nice to be useful to hit I also often have multiple Windows open of HeidiSQL. In that case it could check whether ie. Thanks for the best SQL-Browser on Windows! |
I think the problem with multiple instances could be partially solved if the unsaved tabs are saved in subfolders by connection name like: |
Please, remember this enhancement was requested for the first time in 2012: https://sourceforge.net/p/heidisql/tickets/2991/ A couple of issue-tracker migrations since then... Thank you for your efforts, guys. I really like HeidiSQL, but I'm scared of using it sometimes because it does not backup your work. Kind regards |
I vote for this as well. Pretty simple (seemingly) change, but a major enhancement to the user experience! |
MySql workbench even reopens tabs that were saved but visible when the program is closed and reopened, not just unsaved queries. This is helpful when you are working on a project that needs input from several queries to figure out, but spans multiple days because of phb interruptions :) |
I also would like to see this. I use Heidi for any MySQL queries I do, and this would be a very nice enhancement. |
This is a critical feature. I love Heidi and appreciate all great effort, but I would prioritize this over other enhancements. |
This feature would greatly increase my workflow, since i do not have the time to save every query - but might need them later. |
Been looking for this as well. My co-worker told me he loves Heidi but this is a feature that is missing and would help him a lot. Hope it gets implemented soon. |
I am also looking forward for this feature. Will improve my experience a lot. |
This would also save those who get frequent crashing of HeidiSQL and lose large queries that they were working on. Often when a crash occurs an exception dialog will popup and sometimes clicking on "continue" will actually close the program, or "continue" won't be available. In either case, trying to copy the query out of the tab before closing the exception box is not possible and unsaved queries are lost. Notepad++ also has this feature and it's saved me countless times. |
Hi @ansgarbecker, since quite a few people would find this useful can you give us an idea whether you have already been working on this or when we can expect this in a nightly version? Of course you have a bunch of other things in your 10.2 milestone. This is not to rush anything, just informational. |
This is one of the most and longest wish from many users, so it will be one of the next feature I am going to implement. |
Fantastic news, thanks @ansgarbecker ! |
10MB sound way too much I find. If I export data as SQL and paste it in a tab, then I don't want that saved. |
Yeah I think 10MB is huge for a file. If you want to go full customization, this can be a configurable field where you set max size in kb. |
To ensure this feature is done right there should be some forethought about being able to recover from a corrupt cache that prevents HeidiSQL from loading properly, such as a command line option to skip loading background-saved queries, or on launch after a crash give the option to skip loading background saved queries that may be preventing it from starting up. Also, in regards to file size I would assume it would be fairly trivial to compress the queries before saving to disk since SQL text is highly compressible. Very large queries likely have a lot of repeating text and could be reduced in size drastically with most compression algorithms. |
I would like this feature very much. I would also like some sushi. |
I would appreciate this feature. |
…ile save" checkbox there, and introduce two new checkboxes for restoring opened and unsaved query tab contents (both new yet without functionality in their back)
…ame>\AppData\Roaming\HeidiSQL\Backups\*.sql, and tab setup in C:\Users\<username>\AppData\Roaming\HeidiSQL\tabs.ini
I think I have most parts of this new feature ready to use. Some translation strings are missing yet, and probably not done enough testing yet. For all who want to test the new auto-restore feature:
The auto-restore feature is activated by default, and can be disabled in Preferences > Files > "Reopen previously used SQL files..." |
I think the current implementation is not yet safe against running multiple instances... Please be aware of that if you already use this feature. |
nothing important should remain unsaved anyway. It can't be worse than before the feature implementation when all the unsaved queries were gone by default. |
This only seems to restore the first tab for me atm Edit: Looks like the tab restore function needs to be offset by 1 when restoring? I exit with 4 query tabs open (unsaved), then restart HeidiSQL, and I get 3 query tabs back ... and then after trying it again after typing this, it consistently auto-restores. Not going to delete this comment myself just incase this needs looking into |
I just tested with a blank setup and the latest build. I can reproduce that if I am very quickly closing HeidSQL, before the 10 seconds timer for storing the tab setup has reached its first end. So I think the call of => fixed |
…d don't restore tabs from other running processes. If the process no longer runs, restore such tab sections again, so nothing gets lost with multiple running application instances.
Next nightly build should work stable with multiple HeidiSQL instances, each of them managing its own tab setup, writing to the same tabs.ini file. Tabs get restored if no other running instance is using them. Any more issues here? Please report if you find one. |
What an awesome improvement to my day-to-day work! Thanks for taking the time to implement this! |
I am closing this issue now, as there are no complaints for some days, and I can also find nothing to change. Please shout if you find more issues. |
I think this was a great improvement, but I think the norm with other applications (e.g. Notepad++) is that when the user manually closes a Window it always asks him for confirmation to save the contents or not. Only when the program is closed (e.g. when it is upgrading to a new version) does the auto-backup apply. |
I agree with @igitur , this is a bug to do with this change. Tabs still need to prompt if the user closes them within the application |
Ah, then I misunderstood that question. I assumed it meant specifically to "Keep asking this question" when closing the files in bulk (e.g. when closing/upgrading the application). |
I have that box ticked, and my application doesn't prompt me when I close a tab. I may have unticked Edit: No, you're right - its my settings! |
Still an issue, described in the forum: physically existing files loaded into a tab are restored even when the user closed them in the previous session. |
…ed some physical file. Fixes wrongly restored tabs which were closed in previous session.
Just fixed that for the next build. Closed tabs with manually loaded files should no longer be restored in the next session. |
Can confirm the fix in build 10.1.0.5585. |
Should bound parameters also be restored? |
They are not currently, but I guess they should be, right? But please file another issue for solving that. |
…(). Also, use its own Write() method instead of StreamWrite(), which encodes UTF8 first, so the new approach is probably faster. Probably also helps with non-writable tab backups on some systems.
…M, now load them in this encoding, not in UTF8 with BOM * see deab987 * see https://www.heidisql.com/forum.php?t=35551
Note that since v12.1, the auto-created backup file of a user-closed tab is now deleted to the recycle bin. Previously, they were just deleted without any possibility to restore. So, even when you closed a tab, by accident or not, you may restore its content. |
@ansgarbecker You just saved me from a heart attack! I had some important information in a few queries, and the tabs were closed. I'm so relieved that I found the content in the recycle bin! 😄 |
Current behavior
*
when unsavedExpected behavior
Possible solution
%appdata%\HeidiSQL\unsaved Queries
Environment
9.5.0.5248
Windows 10 1709
Comment
I use those queries for debugging. They are not relevant enough to save them for ever but I'd like them to be there for 1-2 weeks until they aren't relevant anymore.
The text was updated successfully, but these errors were encountered: