You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present a missing key in a .delete call returns StoreError::LmdbError(lmdb::error::Error::NotFound). It is necessary to handle this case specifically in order to implement delete-if-present, which means that consumers need to take a dependency on lmdb-rkv.
One solution for this is to handle NotFound specially in rkv's own interface. I'm open to other suggestions.
The text was updated successfully, but these errors were encountered:
+1. I'd go so far as to say that delete-if-present is the semantics almost everybody wants, and trying to delete a non-existent key should not be considered an error. I propose changing the return type of .delete() to be Result<bool, StoreError>, where the Ok variant is true if the key existed and false if it didn't.
At present a missing key in a
.delete
call returnsStoreError::LmdbError(lmdb::error::Error::NotFound)
. It is necessary to handle this case specifically in order to implement delete-if-present, which means that consumers need to take a dependency onlmdb-rkv
.One solution for this is to handle
NotFound
specially in rkv's own interface. I'm open to other suggestions.The text was updated successfully, but these errors were encountered: