langgraph-checkpoint-postgres 1.0.2__tar.gz → 1.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.
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/PKG-INFO +5 -1
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/README.md +4 -1
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/langgraph/checkpoint/postgres/aio.py +4 -5
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/pyproject.toml +1 -1
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/langgraph/checkpoint/postgres/__init__.py +0 -0
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/langgraph/checkpoint/postgres/base.py +0 -0
- {langgraph_checkpoint_postgres-1.0.2 → langgraph_checkpoint_postgres-1.0.3}/langgraph/checkpoint/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: langgraph-checkpoint-postgres
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Library with a Postgres implementation of LangGraph checkpoint saver.
|
|
5
5
|
Home-page: https://www.github.com/langchain-ai/langgraph
|
|
6
6
|
License: MIT
|
|
@@ -26,6 +26,9 @@ Implementation of LangGraph CheckpointSaver that uses Postgres.
|
|
|
26
26
|
> [!IMPORTANT]
|
|
27
27
|
> When using Postgres checkpointers for the first time, make sure to call `.setup()` method on them to create required tables. See example below.
|
|
28
28
|
|
|
29
|
+
> [!IMPORTANT]
|
|
30
|
+
> When manually creating Postgres connections and passing them to `PostgresSaver` or `AsyncPostgresSaver`, make sure to include `autocommit=True` and `row_factory=dict_row` (`from psycopg.rows import dict_row`). See a full example in this [how-to guide](https://langchain-ai.github.io/langgraph/how-tos/persistence_postgres/).
|
|
31
|
+
|
|
29
32
|
```python
|
|
30
33
|
from langgraph.checkpoint.postgres import PostgresSaver
|
|
31
34
|
|
|
@@ -115,3 +118,4 @@ async with AsyncPostgresSaver.from_conn_string(DB_URI) as checkpointer:
|
|
|
115
118
|
# list checkpoints
|
|
116
119
|
[c async for c in checkpointer.alist(read_config)]
|
|
117
120
|
```
|
|
121
|
+
|
|
@@ -7,6 +7,9 @@ Implementation of LangGraph CheckpointSaver that uses Postgres.
|
|
|
7
7
|
> [!IMPORTANT]
|
|
8
8
|
> When using Postgres checkpointers for the first time, make sure to call `.setup()` method on them to create required tables. See example below.
|
|
9
9
|
|
|
10
|
+
> [!IMPORTANT]
|
|
11
|
+
> When manually creating Postgres connections and passing them to `PostgresSaver` or `AsyncPostgresSaver`, make sure to include `autocommit=True` and `row_factory=dict_row` (`from psycopg.rows import dict_row`). See a full example in this [how-to guide](https://langchain-ai.github.io/langgraph/how-tos/persistence_postgres/).
|
|
12
|
+
|
|
10
13
|
```python
|
|
11
14
|
from langgraph.checkpoint.postgres import PostgresSaver
|
|
12
15
|
|
|
@@ -95,4 +98,4 @@ async with AsyncPostgresSaver.from_conn_string(DB_URI) as checkpointer:
|
|
|
95
98
|
|
|
96
99
|
# list checkpoints
|
|
97
100
|
[c async for c in checkpointer.alist(read_config)]
|
|
98
|
-
```
|
|
101
|
+
```
|
|
@@ -66,11 +66,10 @@ class AsyncPostgresSaver(BasePostgresSaver):
|
|
|
66
66
|
async with self.lock:
|
|
67
67
|
async with self.conn.cursor(binary=True) as cur:
|
|
68
68
|
try:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
).fetchone()["v"]
|
|
69
|
+
results = await cur.execute(
|
|
70
|
+
"SELECT v FROM checkpoint_migrations ORDER BY v DESC LIMIT 1"
|
|
71
|
+
)
|
|
72
|
+
version = (await results.fetchone())["v"]
|
|
74
73
|
except UndefinedTable:
|
|
75
74
|
version = -1
|
|
76
75
|
for v, migration in zip(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|