Collection.rollback() replacement?

hi. i have been away from Anki for several years/revisions. for example, i have had to replace:

from anki import Collection

with

from anki.collection import Collection

in my old scripts, i had occasion to call self.col.rollback(). but, rollback is no longer in a Collection instance. and, i note that self.col.save() is deprecated as “automatic”.

is there a current way of rolling back changes to the database?

sorry for the old references. let me know if you need me to figure out from my (old) scripts what they are doing to a collection when they realize they want to abort.

cheers!

You can either use undoable collection methods, or use .create_backup() prior to making changes.

thanks, looks cool, i’ll look there. and, hooray for type hints.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.