langgraph-checkpoint-sqlite 2.0.9__tar.gz → 2.0.10__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.
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/PKG-INFO +1 -1
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/store/sqlite/base.py +3 -2
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/pyproject.toml +1 -1
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_async_store.py +60 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_store.py +60 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/uv.lock +1 -1
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/.gitignore +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/Makefile +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/README.md +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/cache/sqlite/__init__.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/__init__.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/aio.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/py.typed +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/utils.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/store/sqlite/__init__.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/store/sqlite/aio.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/__init__.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_aiosqlite.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_sqlite.py +0 -0
- {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_ttl.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langgraph-checkpoint-sqlite
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.10
|
|
4
4
|
Summary: Library with a SQLite implementation of LangGraph checkpoint saver.
|
|
5
5
|
Project-URL: Repository, https://www.github.com/langchain-ai/langgraph
|
|
6
6
|
License-Expression: MIT
|
|
@@ -410,11 +410,12 @@ class BaseSqliteStore:
|
|
|
410
410
|
"json_extract(value, '$." + key + "') = " + str(value)
|
|
411
411
|
)
|
|
412
412
|
else:
|
|
413
|
-
#
|
|
413
|
+
# Complex objects (list, dict, …) – compare JSON text
|
|
414
414
|
filter_conditions.append(
|
|
415
415
|
"json_extract(value, '$." + key + "') = ?"
|
|
416
416
|
)
|
|
417
|
-
|
|
417
|
+
# orjson.dumps returns bytes → decode to str so SQLite sees TEXT
|
|
418
|
+
filter_params.append(orjson.dumps(value).decode())
|
|
418
419
|
|
|
419
420
|
# Vector search branch
|
|
420
421
|
if op.query and self.index_config:
|
{langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_async_store.py
RENAMED
|
@@ -657,3 +657,63 @@ async def test_list_namespaces(
|
|
|
657
657
|
# Clean up
|
|
658
658
|
for namespace in test_namespaces:
|
|
659
659
|
await store.adelete(namespace, "dummy")
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
async def test_search_items(
|
|
663
|
+
fake_embeddings: CharacterEmbeddings,
|
|
664
|
+
) -> None:
|
|
665
|
+
"""Test search_items functionality by calling store methods directly."""
|
|
666
|
+
base = "test_search_items"
|
|
667
|
+
test_namespaces = [
|
|
668
|
+
(base, "documents", "user1"),
|
|
669
|
+
(base, "documents", "user2"),
|
|
670
|
+
(base, "reports", "department1"),
|
|
671
|
+
(base, "reports", "department2"),
|
|
672
|
+
]
|
|
673
|
+
test_items = [
|
|
674
|
+
{"title": "Doc 1", "author": "John Doe", "tags": ["important"]},
|
|
675
|
+
{"title": "Doc 2", "author": "Jane Smith", "tags": ["draft"]},
|
|
676
|
+
{"title": "Report A", "author": "John Doe", "tags": ["final"]},
|
|
677
|
+
{"title": "Report B", "author": "Alice Johnson", "tags": ["draft"]},
|
|
678
|
+
]
|
|
679
|
+
|
|
680
|
+
async with create_vector_store(
|
|
681
|
+
fake_embeddings, text_fields=["key0", "key1", "key3"]
|
|
682
|
+
) as store:
|
|
683
|
+
# Insert test data
|
|
684
|
+
for ns, item in zip(test_namespaces, test_items):
|
|
685
|
+
key = f"item_{ns[-1]}"
|
|
686
|
+
await store.aput(ns, key, item)
|
|
687
|
+
|
|
688
|
+
# 1. Search documents
|
|
689
|
+
docs = await store.asearch((base, "documents"))
|
|
690
|
+
assert len(docs) == 2
|
|
691
|
+
assert all(item.namespace[1] == "documents" for item in docs)
|
|
692
|
+
|
|
693
|
+
# 2. Search reports
|
|
694
|
+
reports = await store.asearch((base, "reports"))
|
|
695
|
+
assert len(reports) == 2
|
|
696
|
+
assert all(item.namespace[1] == "reports" for item in reports)
|
|
697
|
+
|
|
698
|
+
# 3. Pagination
|
|
699
|
+
first_page = await store.asearch((base,), limit=2, offset=0)
|
|
700
|
+
second_page = await store.asearch((base,), limit=2, offset=2)
|
|
701
|
+
assert len(first_page) == 2
|
|
702
|
+
assert len(second_page) == 2
|
|
703
|
+
keys_page1 = {item.key for item in first_page}
|
|
704
|
+
keys_page2 = {item.key for item in second_page}
|
|
705
|
+
assert keys_page1.isdisjoint(keys_page2)
|
|
706
|
+
all_items = await store.asearch((base,))
|
|
707
|
+
assert len(all_items) == 4
|
|
708
|
+
|
|
709
|
+
john_items = await store.asearch((base,), filter={"author": "John Doe"})
|
|
710
|
+
assert len(john_items) == 2
|
|
711
|
+
assert all(item.value["author"] == "John Doe" for item in john_items)
|
|
712
|
+
|
|
713
|
+
draft_items = await store.asearch((base,), filter={"tags": ["draft"]})
|
|
714
|
+
assert len(draft_items) == 2
|
|
715
|
+
assert all("draft" in item.value["tags"] for item in draft_items)
|
|
716
|
+
|
|
717
|
+
for ns in test_namespaces:
|
|
718
|
+
key = f"item_{ns[-1]}"
|
|
719
|
+
await store.adelete(ns, key)
|
{langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_store.py
RENAMED
|
@@ -987,3 +987,63 @@ def test_list_namespaces_operations(
|
|
|
987
987
|
# Clean up
|
|
988
988
|
for namespace in test_namespaces:
|
|
989
989
|
store.delete(namespace, "dummy")
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
def test_search_items(
|
|
993
|
+
fake_embeddings: CharacterEmbeddings,
|
|
994
|
+
) -> None:
|
|
995
|
+
"""Test search_items functionality by calling store methods directly."""
|
|
996
|
+
base = "test_search_items"
|
|
997
|
+
test_namespaces = [
|
|
998
|
+
(base, "documents", "user1"),
|
|
999
|
+
(base, "documents", "user2"),
|
|
1000
|
+
(base, "reports", "department1"),
|
|
1001
|
+
(base, "reports", "department2"),
|
|
1002
|
+
]
|
|
1003
|
+
test_items = [
|
|
1004
|
+
{"title": "Doc 1", "author": "John Doe", "tags": ["important"]},
|
|
1005
|
+
{"title": "Doc 2", "author": "Jane Smith", "tags": ["draft"]},
|
|
1006
|
+
{"title": "Report A", "author": "John Doe", "tags": ["final"]},
|
|
1007
|
+
{"title": "Report B", "author": "Alice Johnson", "tags": ["draft"]},
|
|
1008
|
+
]
|
|
1009
|
+
|
|
1010
|
+
with create_vector_store(
|
|
1011
|
+
fake_embeddings, text_fields=["key0", "key1", "key3"]
|
|
1012
|
+
) as store:
|
|
1013
|
+
# Insert test data
|
|
1014
|
+
for ns, item in zip(test_namespaces, test_items):
|
|
1015
|
+
key = f"item_{ns[-1]}"
|
|
1016
|
+
store.put(ns, key, item)
|
|
1017
|
+
|
|
1018
|
+
# 1. Search documents
|
|
1019
|
+
docs = store.search((base, "documents"))
|
|
1020
|
+
assert len(docs) == 2
|
|
1021
|
+
assert all(item.namespace[1] == "documents" for item in docs)
|
|
1022
|
+
|
|
1023
|
+
# 2. Search reports
|
|
1024
|
+
reports = store.search((base, "reports"))
|
|
1025
|
+
assert len(reports) == 2
|
|
1026
|
+
assert all(item.namespace[1] == "reports" for item in reports)
|
|
1027
|
+
|
|
1028
|
+
# 3. Pagination
|
|
1029
|
+
first_page = store.search((base,), limit=2, offset=0)
|
|
1030
|
+
second_page = store.search((base,), limit=2, offset=2)
|
|
1031
|
+
assert len(first_page) == 2
|
|
1032
|
+
assert len(second_page) == 2
|
|
1033
|
+
keys_page1 = {item.key for item in first_page}
|
|
1034
|
+
keys_page2 = {item.key for item in second_page}
|
|
1035
|
+
assert keys_page1.isdisjoint(keys_page2)
|
|
1036
|
+
all_items = store.search((base,))
|
|
1037
|
+
assert len(all_items) == 4
|
|
1038
|
+
|
|
1039
|
+
john_items = store.search((base,), filter={"author": "John Doe"})
|
|
1040
|
+
assert len(john_items) == 2
|
|
1041
|
+
assert all(item.value["author"] == "John Doe" for item in john_items)
|
|
1042
|
+
|
|
1043
|
+
draft_items = store.search((base,), filter={"tags": ["draft"]})
|
|
1044
|
+
assert len(draft_items) == 2
|
|
1045
|
+
assert all("draft" in item.value["tags"] for item in draft_items)
|
|
1046
|
+
|
|
1047
|
+
for ns in test_namespaces:
|
|
1048
|
+
key = f"item_{ns[-1]}"
|
|
1049
|
+
store.delete(ns, key)
|
|
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
|
{langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_aiosqlite.py
RENAMED
|
File without changes
|
{langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_sqlite.py
RENAMED
|
File without changes
|
|
File without changes
|