Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to utilize sqlite for undo/redo features?

I'm writing a desktop application to do vector drawing in C++, and considering using sqlite to back my undo/redo feature.

Has anybody used sqlite for undo/redo features? How does it work out for you?

Clarification:

I was aware of the stack approach, I have even implemented one application with that approach. The problem I encountered was that it becomes hard to maintain after a while.

What I meant by utilizing sqlite is that I will map my entire in-memory data structure into a sqlite database, and let the sqlite do the diff and revision for me. Speed should not be a issue if I create a in-memory database.

That was the idea and I was wondering if that could work.

like image 675
lyxera Avatar asked Mar 31 '09 13:03

lyxera


1 Answers

It makes sense to use SQLite to back undo/redo when an SQLite database is the application's data file format. See the SQLite website for an explanation of how to do this with SQLite triggers.

like image 65
Doug Currie Avatar answered Oct 27 '22 11:10

Doug Currie