langgraph-checkpoint-sqlite 3.0.2__tar.gz → 3.0.3__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 (22) hide show
  1. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/PKG-INFO +2 -2
  2. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/checkpoint/sqlite/aio.py +22 -2
  3. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/pyproject.toml +2 -2
  4. langgraph_checkpoint_sqlite-3.0.3/uv.lock +1278 -0
  5. langgraph_checkpoint_sqlite-3.0.2/uv.lock +0 -1137
  6. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/.gitignore +0 -0
  7. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/LICENSE +0 -0
  8. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/Makefile +0 -0
  9. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/README.md +0 -0
  10. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/cache/sqlite/__init__.py +0 -0
  11. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/checkpoint/sqlite/__init__.py +0 -0
  12. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/checkpoint/sqlite/py.typed +0 -0
  13. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/checkpoint/sqlite/utils.py +0 -0
  14. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/store/sqlite/__init__.py +0 -0
  15. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/store/sqlite/aio.py +0 -0
  16. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/langgraph/store/sqlite/base.py +0 -0
  17. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/tests/__init__.py +0 -0
  18. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/tests/test_aiosqlite.py +0 -0
  19. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/tests/test_async_store.py +0 -0
  20. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/tests/test_sqlite.py +0 -0
  21. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/tests/test_store.py +0 -0
  22. {langgraph_checkpoint_sqlite-3.0.2 → langgraph_checkpoint_sqlite-3.0.3}/tests/test_ttl.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-checkpoint-sqlite
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: Library with a SQLite implementation of LangGraph checkpoint saver.
5
5
  Project-URL: Source, https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-sqlite
6
- Project-URL: Twitter, https://x.com/LangChainAI
6
+ Project-URL: Twitter, https://x.com/LangChain
7
7
  Project-URL: Slack, https://www.langchain.com/join-community
8
8
  Project-URL: Reddit, https://www.reddit.com/r/LangChain/
9
9
  License-Expression: MIT
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import json
5
5
  import random
6
+ import threading
6
7
  from collections.abc import AsyncIterator, Callable, Iterator, Sequence
7
8
  from contextlib import asynccontextmanager
8
9
  from typing import Any, TypeVar, cast
@@ -281,8 +282,7 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]):
281
282
  async with self.lock:
282
283
  if self.is_setup:
283
284
  return
284
- if not self.conn.is_alive():
285
- await self.conn
285
+ await _ensure_connected(self.conn)
286
286
  async with self.conn.executescript(
287
287
  """
288
288
  PRAGMA journal_mode=WAL;
@@ -609,3 +609,23 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]):
609
609
  next_v = current_v + 1
610
610
  next_h = random.random()
611
611
  return f"{next_v:032}.{next_h:016}"
612
+
613
+
614
+ async def _ensure_connected(conn: aiosqlite.Connection) -> None:
615
+ if not _CONN_STARTED_CHECK(conn):
616
+ await conn
617
+
618
+
619
+ def _build_conn_started_check() -> Callable[[aiosqlite.Connection], bool]:
620
+ is_alive = getattr(aiosqlite.Connection, "is_alive", None)
621
+ if callable(is_alive):
622
+ return lambda conn: conn.is_alive() # type: ignore[attr-defined]
623
+
624
+ def _started(conn: aiosqlite.Connection) -> bool:
625
+ thread: threading.Thread | None = getattr(conn, "_thread", None)
626
+ return False if thread is None else thread.is_alive()
627
+
628
+ return _started
629
+
630
+
631
+ _CONN_STARTED_CHECK = _build_conn_started_check()
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "langgraph-checkpoint-sqlite"
7
- version = "3.0.2"
7
+ version = "3.0.3"
8
8
  description = "Library with a SQLite implementation of LangGraph checkpoint saver."
9
9
  authors = []
10
10
  requires-python = ">=3.10"
@@ -19,7 +19,7 @@ dependencies = [
19
19
 
20
20
  [project.urls]
21
21
  Source = "https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-sqlite"
22
- Twitter = "https://x.com/LangChainAI"
22
+ Twitter = "https://x.com/LangChain"
23
23
  Slack = "https://www.langchain.com/join-community"
24
24
  Reddit = "https://www.reddit.com/r/LangChain/"
25
25