Batch

BatchDB

class eth.db.batch.BatchDB(wrapped_db: DatabaseAPI, read_through_deletes: bool = False)

A wrapper of basic DB objects with uncommitted DB changes stored in local cache, which represents as a dictionary of database keys and values. This class should be usable as a context manager, the changes either all fail or all succeed. Upon exiting the context, it writes all of the key value pairs from the cache into the underlying database. If any error occurred before committing phase, we would not apply commits at all.

clear() None.  Remove all items from D.
commit(apply_deletes: bool = True) None
commit_to(target_db: DatabaseAPI, apply_deletes: bool = True) None
diff() DBDiff
logger = <Logger eth.db.BatchDB (WARNING)>
wrapped_db: DatabaseAPI = None