python-rocksdb icon indicating copy to clipboard operation
python-rocksdb copied to clipboard

Still no TtlDB support?

Open kadnan opened this issue 3 years ago • 1 comments

I was wondering whether such support will be provided?

kadnan avatar Oct 03 '22 16:10 kadnan

open with ttl? Try pip install rocksdict. https://github.com/Congyuwang/RocksDict

Then you can have:

from rocksdict import Rdict, AccessType

# 24 hr TTL
db = Rdict(path="db_path", access_type=AccessType.with_ttl(24 * 3600))
db["a"] = 123
db.close()

Congyuwang avatar Nov 06 '22 05:11 Congyuwang