Dear Simon,
sorry for letting you wait.
this is rather a general question than a concrete issue or a bug report: Does baseX provide any snapshoting-alike functionality, i.e. the possibility to automatically save (potentially) affected elements *before* an updating transaction is performed?
BaseX itself has no snapshot features included, but XQuery could be used, e. g. to store elements in second database before they are being updated by the same query. A little example:
let $entries := db:open('db')/entries let $old := $entries/entry[@id = '...'] let $new := <new>element</new> return ( delete node $old, insert node $old into db:open('backup')/entries, insert node $new into $entries )
The backup database could then be used to restore the previously changed or deleted entry. Obviously, some more logic is needed to allow more than a single undo/redo operation (you could e.g. add timestamps to your current and backed up nodes).
Hope this helps, Christian
We have a (existing) GUI which is used to edit data stored in a baseX database. For this GUI, we want to add undo/redo functionality for the user. Snapshoting would be a straightforward approach, but any other hints or ideas are also welcome (maybe using events?).
Thanks in advance, Simon
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk