langgraph-checkpoint-postgres 3.0.3__tar.gz → 3.0.4__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 (26) hide show
  1. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/PKG-INFO +2 -2
  2. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/aio.py +8 -3
  3. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/pyproject.toml +2 -2
  4. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/uv.lock +266 -261
  5. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/.gitignore +0 -0
  6. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/LICENSE +0 -0
  7. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/Makefile +0 -0
  8. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/README.md +0 -0
  9. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/__init__.py +0 -0
  10. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/_ainternal.py +0 -0
  11. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/_internal.py +0 -0
  12. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/aio.py +0 -0
  13. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/base.py +0 -0
  14. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/py.typed +0 -0
  15. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/shallow.py +0 -0
  16. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/__init__.py +0 -0
  17. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/base.py +0 -0
  18. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/py.typed +0 -0
  19. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/__init__.py +0 -0
  20. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/compose-postgres.yml +0 -0
  21. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/conftest.py +0 -0
  22. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/embed_test_utils.py +0 -0
  23. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/test_async.py +0 -0
  24. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/test_async_store.py +0 -0
  25. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/test_store.py +0 -0
  26. {langgraph_checkpoint_postgres-3.0.3 → langgraph_checkpoint_postgres-3.0.4}/tests/test_sync.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langgraph-checkpoint-postgres
3
- Version: 3.0.3
3
+ Version: 3.0.4
4
4
  Summary: Library with a Postgres implementation of LangGraph checkpoint saver.
5
5
  Project-URL: Source, https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-postgres
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
@@ -550,6 +550,11 @@ class AsyncPostgresStore(AsyncBatchedBaseStore, BasePostgresStore[_ainternal.Con
550
550
  Will be applied regardless of whether the PostgresStore instance was initialized with a pipeline.
551
551
  If pipeline mode is not supported, will fall back to using transaction context manager.
552
552
  """
553
+ is_pooled_conn = isinstance(self.conn, AsyncConnectionPool)
554
+ # With AsyncConnectionPool, each _cursor() call checks out its own connection.
555
+ # The pool does not hand out the same connection concurrently, so a shared lock
556
+ # across calls is unnecessary here.
557
+ lock = asyncio.Lock() if is_pooled_conn else self.lock
553
558
  async with _ainternal.get_connection(self.conn) as conn:
554
559
  if self.pipe:
555
560
  # a connection in pipeline mode can be used concurrently
@@ -566,21 +571,21 @@ class AsyncPostgresStore(AsyncBatchedBaseStore, BasePostgresStore[_ainternal.Con
566
571
  # thread/coroutine at a time, so we acquire a lock
567
572
  if self.supports_pipeline:
568
573
  async with (
569
- self.lock,
574
+ lock,
570
575
  conn.pipeline(),
571
576
  conn.cursor(binary=True, row_factory=dict_row) as cur,
572
577
  ):
573
578
  yield cur
574
579
  else:
575
580
  async with (
576
- self.lock,
581
+ lock,
577
582
  conn.transaction(),
578
583
  conn.cursor(binary=True, row_factory=dict_row) as cur,
579
584
  ):
580
585
  yield cur
581
586
  else:
582
587
  async with (
583
- self.lock,
588
+ lock,
584
589
  conn.cursor(binary=True, row_factory=dict_row) as cur,
585
590
  ):
586
591
  yield cur
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "langgraph-checkpoint-postgres"
7
- version = "3.0.3"
7
+ version = "3.0.4"
8
8
  description = "Library with a Postgres implementation of LangGraph checkpoint saver."
9
9
  authors = []
10
10
  requires-python = ">=3.10"
@@ -20,7 +20,7 @@ dependencies = [
20
20
 
21
21
  [project.urls]
22
22
  Source = "https://github.com/langchain-ai/langgraph/tree/main/libs/checkpoint-postgres"
23
- Twitter = "https://x.com/LangChainAI"
23
+ Twitter = "https://x.com/LangChain"
24
24
  Slack = "https://www.langchain.com/join-community"
25
25
  Reddit = "https://www.reddit.com/r/LangChain/"
26
26