diff options
author | drebs <drebs@leap.se> | 2013-02-13 12:46:48 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-13 12:46:48 -0200 |
commit | 82006e3b7e502b9fb4e45a00fdf332e4af5fc752 (patch) | |
tree | 5e1ce005cfd934c10b220623eb403ffe987c4493 /backends/objectstore.py | |
parent | ecf568431319b4e81bc077141048d0b7f1e0964d (diff) |
Add/fix doc for soledad modules.
Diffstat (limited to 'backends/objectstore.py')
-rw-r--r-- | backends/objectstore.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backends/objectstore.py b/backends/objectstore.py index d7aa3049..1ac03df4 100644 --- a/backends/objectstore.py +++ b/backends/objectstore.py @@ -1,3 +1,11 @@ +""" +Abstract U1DB backend to handle storage using object stores (like CouchDB, for +example. + +Right now, this is only used by CouchDatabase backend, but can also be +extended to implement OpenStack or Amazon S3 storage, for example. +""" + from u1db.backends.inmemory import InMemoryDatabase from u1db import errors @@ -37,6 +45,7 @@ class ObjectStore(InMemoryDatabase): raise NotImplementedError(self.get_all_docs) def delete_doc(self, doc): + """Mark a document as deleted.""" old_doc = self._get_doc(doc.doc_id, check_for_conflicts=True) if old_doc is None: raise errors.DocumentDoesNotExist @@ -55,9 +64,13 @@ class ObjectStore(InMemoryDatabase): # index-related methods def create_index(self, index_name, *index_expressions): + """ + Create an named index, which can then be queried for future lookups. + """ raise NotImplementedError(self.create_index) def delete_index(self, index_name): + """Remove a named index.""" super(ObjectStore, self).delete_index(index_name) self._store_u1db_data() |