msiemens/tinydb — pull request #16 by eugene-eeo (2014-07-25 13:33:02+00:00)
Title: Added LRU cache

Now queries are not popped at random from the cache but the least recently used is popped instead. This not only saves the database calculation time for frequently used queries but also makes sure that the less frequently used objects are freed. I.e.

```python
table = db.table('table3', cache_size=1)
query = where('key') == 2

table.search(query)
table.search(where('key') == 1)

assert query not in table._queries_cache
```