feat: add checkpoint postgres migration admin
This commit is contained in:
1 parent
eaa061dd06
commit
9471e72171
10 files changed
+962
-33
No files matched your search
+20
-6
@@ -2,7 +2,7 @@
|
||||
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
CheckpointerType = Literal["memory", "sqlite", "postgres"]
|
||||
|
||||
@@ -16,13 +16,27 @@ class CheckpointerConfig(BaseModel):
|
||||
"'sqlite' persists to a local file (requires langgraph-checkpoint-sqlite). "
|
||||
"'postgres' persists to PostgreSQL (requires langgraph-checkpoint-postgres)."
|
||||
)
|
||||
connection_string: str | None = Field(
|
||||
default=None,
|
||||
description="Connection string for sqlite (file path) or postgres (DSN). "
|
||||
connection_string: str | None = Field(
|
||||
default=None,
|
||||
description="Connection string for sqlite (file path) or postgres (DSN). "
|
||||
"Required for sqlite and postgres types. "
|
||||
"For sqlite, use a file path like '.deer-flow/checkpoints.db' or ':memory:' for in-memory. "
|
||||
"For postgres, use a DSN like 'postgresql://user:pass@localhost:5432/db'.",
|
||||
)
|
||||
"For postgres, use a DSN like 'postgresql://user:pass@localhost:5432/db'.",
|
||||
)
|
||||
dual_read_enabled: bool = Field(
|
||||
default=False,
|
||||
description=(
|
||||
"When type='postgres', read from Postgres first and fall back to legacy "
|
||||
"SQLite checkpoint files when Postgres does not have the requested data."
|
||||
),
|
||||
)
|
||||
dual_read_sqlite_paths: list[str] = Field(
|
||||
default_factory=list,
|
||||
description=(
|
||||
"Legacy SQLite checkpoint database paths used for read fallback. "
|
||||
"Plain paths are resolved the same way as SQLite connection_string."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
# Global configuration instance — None means no checkpointer is configured.
|
||||
|
||||
Reference in new issue
Block a user