Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restart, clears the data stored on disk #47

Closed
wku opened this issue Feb 3, 2015 · 3 comments
Closed

restart, clears the data stored on disk #47

wku opened this issue Feb 3, 2015 · 3 comments

Comments

@wku
Copy link

wku commented Feb 3, 2015

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 added a commit that referenced this issue Feb 3, 2015
�CachingMiddleware somehow assumed that there is no data already stored
in the database. Now we always read it �from the wrapped storage if possible.

Closes �#47
@msiemens
Copy link
Owner

msiemens commented Feb 3, 2015

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

@wku
Copy link
Author

wku commented Feb 7, 2015

thank, everything works.

@msiemens
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants