etoile / CoreObject

Distributed version control + object persistence framework

Home Page:http://coreobject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No way to reload COUndoTrackStore

qmathe opened this issue · comments

I'm looking for a way to reload COUndoTrackStore at run-time. The goal is to import a backup that consists of a CoreObject store plus the undo track store that goes along with it, and doing so while my application is running.

Something like -[COUndoTrackStore reload](similar to COUndoTrackStore initializer) could be good enough. -[COUndoTrackStore reload] could post a change notification telling the undo tracks to reload their content for the new undo track store.

This would be a private API though. Not sure if we should add public API like +[COUndoTrack reloadUndoTrackStore] or similar.

Iirc, should be straightforward.

It would be dangerous to replace the sqlite db files with other ones while CoreObject is running. But if you can be sure all sqlite db connections are closed, should be safe. (But then you wouldn't need a reload method?)

Might be better to have a -export and -import: methods that write/read json.

I'm just on my phone at the moment so will take a look at the code later.