Reorganize env config sections, add data store config to env file.

• Add namespace prefix config option
• Make AGE graph name optional
• Update env variable requirements
• Add comments for deprecated options
This commit is contained in:
yangdx
2025-02-12 21:48:48 +08:00
parent fc0f522ed5
commit cf61bed62c
3 changed files with 65 additions and 55 deletions

View File

@@ -75,8 +75,8 @@ class AGEStorage(BaseGraphStorage):
.replace("'", "\\'")
)
HOST = os.environ["AGE_POSTGRES_HOST"].replace("\\", "\\\\").replace("'", "\\'")
PORT = int(os.environ["AGE_POSTGRES_PORT"])
self.graph_name = os.environ["AGE_GRAPH_NAME"]
PORT = os.environ.get("AGE_POSTGRES_PORT", "8529")
self.graph_name = namespace or os.environ.get("AGE_GRAPH_NAME", "lightrag")
connection_string = f"dbname='{DB}' user='{USER}' password='{PASSWORD}' host='{HOST}' port={PORT}"