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.
Files changed (20) hide show
  1. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/PKG-INFO +1 -1
  2. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/store/sqlite/base.py +3 -2
  3. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/pyproject.toml +1 -1
  4. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_async_store.py +60 -0
  5. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_store.py +60 -0
  6. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/uv.lock +1 -1
  7. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/.gitignore +0 -0
  8. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/Makefile +0 -0
  9. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/README.md +0 -0
  10. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/cache/sqlite/__init__.py +0 -0
  11. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/__init__.py +0 -0
  12. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/aio.py +0 -0
  13. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/py.typed +0 -0
  14. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/checkpoint/sqlite/utils.py +0 -0
  15. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/store/sqlite/__init__.py +0 -0
  16. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/langgraph/store/sqlite/aio.py +0 -0
  17. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/__init__.py +0 -0
  18. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_aiosqlite.py +0 -0
  19. {langgraph_checkpoint_sqlite-2.0.9 → langgraph_checkpoint_sqlite-2.0.10}/tests/test_sqlite.py +0 -0
  20. {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.9
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
- # For complex objects, use param binding with JSON serialization
413
+ # Complex objects (list, dict, …) – compare JSON text
414
414
  filter_conditions.append(
415
415
  "json_extract(value, '$." + key + "') = ?"
416
416
  )
417
- filter_params.append(orjson.dumps(value))
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:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "langgraph-checkpoint-sqlite"
7
- version = "2.0.9"
7
+ version = "2.0.10"
8
8
  description = "Library with a SQLite implementation of LangGraph checkpoint saver."
9
9
  authors = []
10
10
  requires-python = ">=3.9"
@@ -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)
@@ -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)
@@ -346,7 +346,7 @@ dev = [
346
346
 
347
347
  [[package]]
348
348
  name = "langgraph-checkpoint-sqlite"
349
- version = "2.0.9"
349
+ version = "2.0.10"
350
350
  source = { editable = "." }
351
351
  dependencies = [
352
352
  { name = "aiosqlite" },