twmht / python-rocksdb

Python bindings for RocksDB
BSD 3-Clause "New" or "Revised" License
274 stars 89 forks source link

Still no TtlDB support? #104

Open kadnan opened 1 year ago

kadnan commented 1 year ago

I was wondering whether such support will be provided?

Congyuwang commented 1 year ago

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()