blitzdb icon indicating copy to clipboard operation
blitzdb copied to clipboard

object file not saved

Open flamingtop opened this issue 8 years ago • 1 comments

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 ../

flamingtop avatar May 11 '16 19:05 flamingtop

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

adewes avatar May 12 '16 20:05 adewes