def abort_txn(self): """ Abort the transaction. """ if not self._txn: raise PyolsProgrammerError("No transaction is active; " "cannot about a non-existent txn!") self._txn.rollback() self._txn = None objectstore.clear()
def reset(self): """ Clean out and reset the database. > db.connect(...) > db.create() ... add things ... > db.reset() The db is now at the state it was when create() was called. """ # Probably only useful during testing... objectstore.clear() drop_all() setup_all(create_tables=True)