tinydb-smartcache provides a smart query cache for TinyDB. It updates the
query cache when inserting/removing/updating elements so the cache doesn't get
invalidated. It's useful if you perform lots of queries while the data changes
only a little.
$ pip install tinydb_smartcache>>>fromtinydbimportTinyDB>>>fromtinydb_smartcacheimportSmartCacheTable>>>db=TinyDB('db.json')
>>>db.table_class=SmartCacheTable>>>db.table('foo')
>>># foo will now use the smart query cacheIf you want to enable TinyDB for all databases in a session, run:
>>>fromtinydbimportTinyDB>>>fromtinydb_smartcacheimportSmartCacheTable>>>TinyDB.table_class=SmartCacheTable>>># All databases/tables will now use the smart query cache- Account for changes in TinyDB 3.0
- Fix installation via pip
- Initial release on PyPI