From 9b9f98916089e6e6585551c34d0d923e02c400e8 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 18 Feb 2025 10:24:19 +0100 Subject: [PATCH] Update postgres_impl.py --- lightrag/kg/postgres_impl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 199a8440..eb7fd2a0 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -307,7 +307,8 @@ class PGKVStorage(BaseKVStorage): """Drop the storage""" drop_sql = SQL_TEMPLATES["drop_all"] await self.db.execute(drop_sql) - + + @final @dataclass class PGVectorStorage(BaseVectorStorage): @@ -549,11 +550,13 @@ class PGDocStatusStorage(DocStatusStorage): }, ) return data + async def drop(self) -> None: """Drop the storage""" drop_sql = SQL_TEMPLATES["drop_doc_full"] await self.db.execute(drop_sql) + class PGGraphQueryException(Exception): """Exception for the AGE queries.""" @@ -1033,7 +1036,7 @@ class PGGraphStorage(BaseGraphStorage): self, node_label: str, max_depth: int = 5 ) -> KnowledgeGraph: raise NotImplementedError - + async def drop(self) -> None: """Drop the storage""" drop_sql = SQL_TEMPLATES["drop_vdb_entity"] @@ -1041,6 +1044,7 @@ class PGGraphStorage(BaseGraphStorage): drop_sql = SQL_TEMPLATES["drop_vdb_relation"] await self.db.execute(drop_sql) + NAMESPACE_TABLE_MAP = { NameSpace.KV_STORE_FULL_DOCS: "LIGHTRAG_DOC_FULL", NameSpace.KV_STORE_TEXT_CHUNKS: "LIGHTRAG_DOC_CHUNKS", @@ -1245,5 +1249,4 @@ SQL_TEMPLATES = { "drop_vdb_relation": """ DROP TABLE IF EXISTS LIGHTRAG_VDB_RELATION CASCADE; """, - }