shelfdb 3.1.0__tar.gz → 3.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {shelfdb-3.1.0 → shelfdb-3.1.1}/PKG-INFO +1 -1
- {shelfdb-3.1.0 → shelfdb-3.1.1}/pyproject.toml +1 -1
- {shelfdb-3.1.0 → shelfdb-3.1.1}/pyproject.toml.orig +1 -1
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/shelf/query.py +1 -1
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/shelf/storage.py +7 -3
- {shelfdb-3.1.0 → shelfdb-3.1.1}/LICENSE +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/README.md +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/__init__.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/__main__.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/cli.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/client/__init__.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/client/client.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/__init__.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/demo_poc.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/protocol.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/query_result.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/server.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/session.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/protocol/write_admission.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/shelf/__init__.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/shelf/db.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/shelf/schema.py +0 -0
- {shelfdb-3.1.0 → shelfdb-3.1.1}/src/shelfdb/target.py +0 -0
|
@@ -80,7 +80,7 @@ class ShelfQuery:
|
|
|
80
80
|
def _load_items(self, items: Iterator[Item]) -> Iterator[Item]:
|
|
81
81
|
for item in items:
|
|
82
82
|
if item.value is UNDEF:
|
|
83
|
-
if (value := self._store.get(item.key)) is not
|
|
83
|
+
if (value := self._store.get(item.key, UNDEF)) is not UNDEF:
|
|
84
84
|
yield Item(item.key, value)
|
|
85
85
|
else:
|
|
86
86
|
yield item
|
|
@@ -166,11 +166,15 @@ class ShelfStore:
|
|
|
166
166
|
):
|
|
167
167
|
self._handle = _ShelfHandle(tx, db)
|
|
168
168
|
|
|
169
|
-
def get(self, key: str
|
|
170
|
-
"""Return the unpacked value
|
|
169
|
+
def get(self, key: str, default: Any = None) -> Any:
|
|
170
|
+
"""Return the unpacked value, or ``default`` only when the key is absent.
|
|
171
|
+
|
|
172
|
+
A stored MessagePack null is a present value and always returns ``None``.
|
|
173
|
+
Callers needing to distinguish it from absence can supply a sentinel.
|
|
174
|
+
"""
|
|
171
175
|
value = self._handle.tx.get(key.encode(), db=self._handle.db)
|
|
172
176
|
if value is None:
|
|
173
|
-
return
|
|
177
|
+
return default
|
|
174
178
|
return unpackb(value)
|
|
175
179
|
|
|
176
180
|
def put(self, key: str, value: Any) -> MutationResult:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|