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

object file not saved #65

Open
flamingtop opened this issue May 11, 2016 · 1 comment
Open

object file not saved #65

flamingtop opened this issue May 11, 2016 · 1 comment

Comments

@flamingtop
Copy link

flamingtop commented May 11, 2016

python 2.7.6 & 3.5.32
blitzdb 0.2.12

console commands

from blitzdb import Docment, FileBackend
backend = FileBackend('./test-blitz-db')
Document({'name', 'myname'}).save(backend)

no errors.

But the object file isn't saved at all.



~ > ls -Ral test-blitz-db
test-blitz-db:
total 16K
drwxrwxr-x  3 shawn 4.0K May 11 15:49 ./
drwxr-xr-x 59 shawn 4.0K May 11 15:53 ../
-rw-rw-r--  1 shawn  254 May 11 15:49 config.json
drwxrwxr-x  4 shawn 4.0K May 11 15:49 document/

test-blitz-db/document:
total 16K
drwxrwxr-x 4 shawn 4.0K May 11 15:49 ./
drwxrwxr-x 3 shawn 4.0K May 11 15:49 ../
drwxrwxr-x 3 shawn 4.0K May 11 15:49 indexes/
drwxrwxr-x 2 shawn 4.0K May 11 15:49 objects/

test-blitz-db/document/indexes:
total 12K
drwxrwxr-x 3 shawn 4.0K May 11 15:49 ./
drwxrwxr-x 4 shawn 4.0K May 11 15:49 ../
drwxrwxr-x 2 shawn 4.0K May 11 15:49 deb83eae6d5942e5b38f11f4ed13dd2c/

test-blitz-db/document/indexes/deb83eae6d5942e5b38f11f4ed13dd2c:
total 8.0K
drwxrwxr-x 2 shawn 4.0K May 11 15:49 ./
drwxrwxr-x 3 shawn 4.0K May 11 15:49 ../

test-blitz-db/document/objects:
total 8.0K
drwxrwxr-x 2 shawn 4.0K May 11 15:49 ./
drwxrwxr-x 4 shawn 4.0K May 11 15:49 ../
@adewes
Copy link
Owner

adewes commented May 12, 2016

You need to call backend.commit() to persist the changes to disk:

http://blitzdb.readthedocs.io/en/latest/backends/file.html#blitzdb.backends.file.Backend.commit

Alternatively, you can set autocommit=True when creating the backend:

backend.autocommit = True

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