The original question talks about opening the __file__ "old.db" in read-only mode. For whatever reason, you seem to assume this means treating the database as read-only (when in actuality, it is possible to just write the changes to an external 'diff' file.)