kvgit 0.1.7__tar.gz → 0.1.8__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.
- {kvgit-0.1.7 → kvgit-0.1.8}/PKG-INFO +1 -1
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/indexeddb.py +10 -3
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/PKG-INFO +1 -1
- {kvgit-0.1.7 → kvgit-0.1.8}/pyproject.toml +1 -1
- {kvgit-0.1.7 → kvgit-0.1.8}/LICENSE +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/README.md +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/__init__.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/content_types.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/encoding.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/errors.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/__init__.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/base.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/composite.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/disk.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/kv/memory.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/namespaced.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/py.typed +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/staged.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/store.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/__init__.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/base.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/gp.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/helpers.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/kv.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/merge.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit/versioned/protocol.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/SOURCES.txt +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/dependency_links.txt +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/requires.txt +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/kvgit.egg-info/top_level.txt +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/setup.cfg +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_content_types.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_namespaced.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_staged.py +0 -0
- {kvgit-0.1.7 → kvgit-0.1.8}/tests/test_store_factory.py +0 -0
|
@@ -117,10 +117,17 @@ async def _idb_tx_complete(tx):
|
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
def _to_bytes(js_value) -> bytes | None:
|
|
120
|
-
"""Convert a JS result to bytes, or None if absent.
|
|
120
|
+
"""Convert a JS result to bytes, or None if absent.
|
|
121
|
+
|
|
122
|
+
Uses Uint8Array.to_py() for fast memcpy from JS to WASM memory,
|
|
123
|
+
avoiding the slow element-wise iteration of bytes(js_proxy).
|
|
124
|
+
"""
|
|
121
125
|
if js_value is None or js_value is undefined:
|
|
122
126
|
return None
|
|
123
|
-
|
|
127
|
+
from js import Uint8Array # type: ignore[import-not-found]
|
|
128
|
+
|
|
129
|
+
arr = Uint8Array.new(js_value)
|
|
130
|
+
return arr.to_py().tobytes()
|
|
124
131
|
|
|
125
132
|
|
|
126
133
|
class IndexedDB(KVStore):
|
|
@@ -206,7 +213,7 @@ class IndexedDB(KVStore):
|
|
|
206
213
|
def on_success(event):
|
|
207
214
|
cursor = event.target.result
|
|
208
215
|
if cursor:
|
|
209
|
-
results.append((str(cursor.key),
|
|
216
|
+
results.append((str(cursor.key), _to_bytes(cursor.value)))
|
|
210
217
|
cursor.continue_()
|
|
211
218
|
else:
|
|
212
219
|
resolve(None)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kvgit"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.8"
|
|
8
8
|
description = "Versioned key-value store with git-like commit, branch, and merge semantics."
|
|
9
9
|
authors = [{ name = "ashenfad" }]
|
|
10
10
|
requires-python = ">=3.10"
|
|
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
|
|
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
|