We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 22c7e13 commit 8245ea0Copy full SHA for 8245ea0
libs/checkpoint-postgres/README.md
@@ -65,6 +65,27 @@ for await (const checkpoint of checkpointer.list(readConfig)) {
65
}
66
```
67
68
+## Usage with existing connection pool
69
+
70
+```ts
71
+import { PostgresSaver } from "@langchain/langgraph-checkpoint-postgres";
72
+import pg from "pg";
73
74
+// You can use any existing postgres connection pool
75
+// we create a new pool here for the sake of the example
76
+const pool = new pg.Pool({
77
+ connectionString: "postgresql://..."
78
+});
79
80
+const checkpointer = new PostgresSaver(pool, undefined, {
81
+ schema: "schema_name"
82
83
84
+await checkpointer.setup();
85
86
+// ...
87
+```
88
89
## Testing
90
91
Spin up testing PostgreSQL
0 commit comments