Closed bluepuma77 closed 4 years ago
Thanks for this great piece of software, it really makes dealing with key/value pairs and sqlite so much easier.
The documentation is good, I am just missing SELECT error handling and a DELETE example.
try: value = db[key] except KeyError: print('Key not found', key)
What's the best way to DELETE a key/value pair from sqlite?
The easiest way to delete items is del db[key], as SqliteDict implements __delitem__:
del db[key]
SqliteDict
__delitem__
https://github.com/RaRe-Technologies/sqlitedict/blob/f5c57f1f833e251b8ffe2e63642d4923b52646cd/sqlitedict.py#L257-L266
Perfect, thanks!
Thanks for this great piece of software, it really makes dealing with key/value pairs and sqlite so much easier.
The documentation is good, I am just missing SELECT error handling and a DELETE example.
What's the best way to DELETE a key/value pair from sqlite?