msiemens/tinydb

restart, clears the data stored on disk

wku opened this issue · 3 comments

wku commented

from tinydb import TinyDB, where
from tinydb.storages import JSONStorage, Storage
from tinydb.middlewares import CachingMiddleware, Middleware
db = TinyDB('db1.json', storage=CachingMiddleware(JSONStorage))
print db.all()

[]

db.insert({'test': 1})
db.close()
print db.all()

[{'test': 1}]

Thanks for reporting! This should be fixed in 45a4d4b. Can you confirm this?

wku commented

thank, everything works.

Great! I've just released v2.2.2, where this is fixed :)