langgraph-checkpoint-postgres 3.0.2__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.
- langgraph_checkpoint_postgres-3.0.4/.gitignore +102 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/PKG-INFO +3 -3
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/aio.py +8 -3
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/base.py +4 -1
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/pyproject.toml +3 -3
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/uv.lock +267 -262
- langgraph_checkpoint_postgres-3.0.2/.gitignore +0 -184
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/LICENSE +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/Makefile +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/README.md +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/_ainternal.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/_internal.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/aio.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/base.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/py.typed +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/checkpoint/postgres/shallow.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/langgraph/store/postgres/py.typed +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/__init__.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/compose-postgres.yml +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/conftest.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/embed_test_utils.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/test_async.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/test_async_store.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/test_store.py +0 -0
- {langgraph_checkpoint_postgres-3.0.2 → langgraph_checkpoint_postgres-3.0.4}/tests/test_sync.py +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
.vs/
|
|
2
|
+
.vscode/
|
|
3
|
+
.idea/
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
|
|
54
|
+
# Django stuff:
|
|
55
|
+
*.log
|
|
56
|
+
local_settings.py
|
|
57
|
+
db.sqlite3
|
|
58
|
+
db.sqlite3-journal
|
|
59
|
+
|
|
60
|
+
# PyBuilder
|
|
61
|
+
target/
|
|
62
|
+
|
|
63
|
+
# Jupyter Notebook
|
|
64
|
+
.ipynb_checkpoints
|
|
65
|
+
notebooks/
|
|
66
|
+
|
|
67
|
+
# IPython
|
|
68
|
+
profile_default/
|
|
69
|
+
ipython_config.py
|
|
70
|
+
|
|
71
|
+
# pyenv
|
|
72
|
+
.python-version
|
|
73
|
+
|
|
74
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
75
|
+
__pypackages__/
|
|
76
|
+
|
|
77
|
+
# Environments
|
|
78
|
+
.env
|
|
79
|
+
.envrc
|
|
80
|
+
.venv
|
|
81
|
+
.venvs
|
|
82
|
+
env/
|
|
83
|
+
venv/
|
|
84
|
+
ENV/
|
|
85
|
+
env.bak/
|
|
86
|
+
venv.bak/
|
|
87
|
+
|
|
88
|
+
# mypy
|
|
89
|
+
.mypy_cache/
|
|
90
|
+
.dmypy.json
|
|
91
|
+
dmypy.json
|
|
92
|
+
|
|
93
|
+
# Pyre type checker
|
|
94
|
+
.pyre/
|
|
95
|
+
|
|
96
|
+
# macOS display setting files
|
|
97
|
+
.DS_Store
|
|
98
|
+
|
|
99
|
+
.vercel
|
|
100
|
+
.turbo
|
|
101
|
+
.editorconfig
|
|
102
|
+
.scratch
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langgraph-checkpoint-postgres
|
|
3
|
-
Version: 3.0.
|
|
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/
|
|
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
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
|
-
Requires-Dist: langgraph-checkpoint<
|
|
12
|
+
Requires-Dist: langgraph-checkpoint<5.0.0,>=2.1.2
|
|
13
13
|
Requires-Dist: orjson>=3.10.1
|
|
14
14
|
Requires-Dist: psycopg-pool>=3.2.0
|
|
15
15
|
Requires-Dist: psycopg>=3.2.0
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
588
|
+
lock,
|
|
584
589
|
conn.cursor(binary=True, row_factory=dict_row) as cur,
|
|
585
590
|
):
|
|
586
591
|
yield cur
|
|
@@ -151,6 +151,7 @@ class PoolConfig(TypedDict, total=False):
|
|
|
151
151
|
"""Connection pool settings for PostgreSQL connections.
|
|
152
152
|
|
|
153
153
|
Controls connection lifecycle and resource utilization:
|
|
154
|
+
|
|
154
155
|
- Small pools (1-5) suit low-concurrency workloads
|
|
155
156
|
- Larger pools handle concurrent requests but consume more resources
|
|
156
157
|
- Setting max_size prevents resource exhaustion under load
|
|
@@ -166,6 +167,7 @@ class PoolConfig(TypedDict, total=False):
|
|
|
166
167
|
"""Additional connection arguments passed to each connection in the pool.
|
|
167
168
|
|
|
168
169
|
Default kwargs set automatically:
|
|
170
|
+
|
|
169
171
|
- autocommit: True
|
|
170
172
|
- prepare_threshold: 0
|
|
171
173
|
- row_factory: dict_row
|
|
@@ -656,7 +658,8 @@ class PostgresStore(BaseStore, BasePostgresStore[_pg_internal.Conn]):
|
|
|
656
658
|
item = store.get(("users", "123"), "prefs")
|
|
657
659
|
```
|
|
658
660
|
|
|
659
|
-
Or using the convenient from_conn_string helper:
|
|
661
|
+
Or using the convenient `from_conn_string` helper:
|
|
662
|
+
|
|
660
663
|
```python
|
|
661
664
|
from langgraph.store.postgres import PostgresStore
|
|
662
665
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langgraph-checkpoint-postgres"
|
|
7
|
-
version = "3.0.
|
|
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"
|
|
@@ -12,7 +12,7 @@ readme = "README.md"
|
|
|
12
12
|
license = "MIT"
|
|
13
13
|
license-files = ['LICENSE']
|
|
14
14
|
dependencies = [
|
|
15
|
-
"langgraph-checkpoint>=2.1.2,<
|
|
15
|
+
"langgraph-checkpoint>=2.1.2,<5.0.0",
|
|
16
16
|
"orjson>=3.10.1",
|
|
17
17
|
"psycopg>=3.2.0",
|
|
18
18
|
"psycopg-pool>=3.2.0",
|
|
@@ -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/
|
|
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
|
|