Update postgres_impl.py

This commit is contained in:
Saifeddine ALOUI
2025-02-18 10:24:19 +01:00
committed by GitHub
parent 20909e495b
commit 9b9f989160

View File

@@ -308,6 +308,7 @@ class PGKVStorage(BaseKVStorage):
drop_sql = SQL_TEMPLATES["drop_all"] drop_sql = SQL_TEMPLATES["drop_all"]
await self.db.execute(drop_sql) await self.db.execute(drop_sql)
@final @final
@dataclass @dataclass
class PGVectorStorage(BaseVectorStorage): class PGVectorStorage(BaseVectorStorage):
@@ -549,11 +550,13 @@ class PGDocStatusStorage(DocStatusStorage):
}, },
) )
return data return data
async def drop(self) -> None: async def drop(self) -> None:
"""Drop the storage""" """Drop the storage"""
drop_sql = SQL_TEMPLATES["drop_doc_full"] drop_sql = SQL_TEMPLATES["drop_doc_full"]
await self.db.execute(drop_sql) await self.db.execute(drop_sql)
class PGGraphQueryException(Exception): class PGGraphQueryException(Exception):
"""Exception for the AGE queries.""" """Exception for the AGE queries."""
@@ -1041,6 +1044,7 @@ class PGGraphStorage(BaseGraphStorage):
drop_sql = SQL_TEMPLATES["drop_vdb_relation"] drop_sql = SQL_TEMPLATES["drop_vdb_relation"]
await self.db.execute(drop_sql) await self.db.execute(drop_sql)
NAMESPACE_TABLE_MAP = { NAMESPACE_TABLE_MAP = {
NameSpace.KV_STORE_FULL_DOCS: "LIGHTRAG_DOC_FULL", NameSpace.KV_STORE_FULL_DOCS: "LIGHTRAG_DOC_FULL",
NameSpace.KV_STORE_TEXT_CHUNKS: "LIGHTRAG_DOC_CHUNKS", NameSpace.KV_STORE_TEXT_CHUNKS: "LIGHTRAG_DOC_CHUNKS",
@@ -1245,5 +1249,4 @@ SQL_TEMPLATES = {
"drop_vdb_relation": """ "drop_vdb_relation": """
DROP TABLE IF EXISTS LIGHTRAG_VDB_RELATION CASCADE; DROP TABLE IF EXISTS LIGHTRAG_VDB_RELATION CASCADE;
""", """,
} }