msiemens / tinydb

TinyDB is a lightweight document oriented database optimized for your happiness :)
https://tinydb.readthedocs.org
MIT License
6.75k stars 536 forks source link

restart, clears the data stored on disk #47

Closed wku closed 9 years ago

wku commented 9 years ago

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}]

msiemens commented 9 years ago

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

wku commented 9 years ago

thank, everything works.

msiemens commented 9 years ago

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