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; """, - }