Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit adb5c4b

Browse files
committed
Add db.all(), fix caching
1 parent 1d7a64b commit adb5c4b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

orbitdbapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.0.rc.1.dev7'
1+
__version__ = '0.1.0.rc.1.dev9'

orbitdbapi/db.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ def iterator(self, params):
151151
def index(self):
152152
endpoint = '/'.join(['db', self.__id_safe, 'index'])
153153
result = self.__client._call('get', endpoint)
154-
self.__cache = result
154+
return result
155+
156+
def all(self):
157+
endpoint = '/'.join(['db', self.__id_safe, 'all'])
158+
result = self.__client._call('get', endpoint)
159+
if isinstance(result, Hashable):
160+
self.__cache = result
155161
return result
156162

157163
def remove(self, item):

0 commit comments

Comments
 (0)