Auto save queries and edit history #13

Open
opened 2018-05-02 09:37:17 +00:00 by eelke · 3 comments
eelke commented 2018-05-02 09:37:17 +00:00 (Migrated from gitlab.com)

Save changes often and remember history of changes so query isn't lost on crash.

Changes can be tracked by using the void QTextDocument::contentsChange(int position, int charsRemoved, int charsAdded) signal. If we make copy of original file and replay these changes we can replay them in case of a crash. Would probably be a good idea to flush these changes to a backup file very x minutes or amount of changes.

We also need a list of open documents. For each document:

  • connection id
  • associated filename (can be empty for new files)
  • work filename (something like %LOCALAPPDATA%\pgLab\editor\backup-{GUID})
    Folder contains
    -- snapshot.000-999
    -- change.log

Make shure to write new files always to temp name then rename current to old and new to current, then remove old.

Save changes often and remember history of changes so query isn't lost on crash. Changes can be tracked by using the void QTextDocument::contentsChange(int position, int charsRemoved, int charsAdded) signal. If we make copy of original file and replay these changes we can replay them in case of a crash. Would probably be a good idea to flush these changes to a backup file very x minutes or amount of changes. We also need a list of open documents. For each document: - connection id - associated filename (can be empty for new files) - work filename (something like %LOCALAPPDATA%\pgLab\editor\backup-{GUID}) Folder contains -- snapshot.000-999 -- change.log Make shure to write new files always to temp name then rename current to old and new to current, then remove old.
eelke commented 2018-11-08 21:30:36 +00:00 (Migrated from gitlab.com)

changed milestone to %1

changed milestone to %1
eelke commented 2018-11-25 18:29:22 +00:00 (Migrated from gitlab.com)

removed milestone

removed milestone
eelke commented 2019-08-19 13:47:41 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: eelke/pgLab#13
No description provided.