Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Removes a key/data pair from the database
"""
self.db.delete(key, txn or self.txn, **kwargs)
# test code
if __name__ == "__main__":
print("1")
from bsddb3 import db, dbshelve
print("2")
x = db.DBEnv()
print("3")
x.open('/tmp', db.DB_CREATE | db.DB_PRIVATE |\
db.DB_INIT_MPOOL |\
db.DB_INIT_LOG | db.DB_INIT_TXN)
print("4")
d = dbshelve.DBShelf(x)
print("5")
#from tran import BSDDBTxn as T
print("6")
T = BSDDBTxn
with T(x) as tx:
print("stat", tx.stat())
print("id", tx.id())
tx.checkpoint()