Update postgres_impl.py
Browse files
lightrag/kg/postgres_impl.py
CHANGED
@@ -307,7 +307,8 @@ class PGKVStorage(BaseKVStorage):
|
|
307 |
"""Drop the storage"""
|
308 |
drop_sql = SQL_TEMPLATES["drop_all"]
|
309 |
await self.db.execute(drop_sql)
|
310 |
-
|
|
|
311 |
@final
|
312 |
@dataclass
|
313 |
class PGVectorStorage(BaseVectorStorage):
|
@@ -549,11 +550,13 @@ class PGDocStatusStorage(DocStatusStorage):
|
|
549 |
},
|
550 |
)
|
551 |
return data
|
|
|
552 |
async def drop(self) -> None:
|
553 |
"""Drop the storage"""
|
554 |
drop_sql = SQL_TEMPLATES["drop_doc_full"]
|
555 |
await self.db.execute(drop_sql)
|
556 |
|
|
|
557 |
class PGGraphQueryException(Exception):
|
558 |
"""Exception for the AGE queries."""
|
559 |
|
@@ -1033,7 +1036,7 @@ class PGGraphStorage(BaseGraphStorage):
|
|
1033 |
self, node_label: str, max_depth: int = 5
|
1034 |
) -> KnowledgeGraph:
|
1035 |
raise NotImplementedError
|
1036 |
-
|
1037 |
async def drop(self) -> None:
|
1038 |
"""Drop the storage"""
|
1039 |
drop_sql = SQL_TEMPLATES["drop_vdb_entity"]
|
@@ -1041,6 +1044,7 @@ class PGGraphStorage(BaseGraphStorage):
|
|
1041 |
drop_sql = SQL_TEMPLATES["drop_vdb_relation"]
|
1042 |
await self.db.execute(drop_sql)
|
1043 |
|
|
|
1044 |
NAMESPACE_TABLE_MAP = {
|
1045 |
NameSpace.KV_STORE_FULL_DOCS: "LIGHTRAG_DOC_FULL",
|
1046 |
NameSpace.KV_STORE_TEXT_CHUNKS: "LIGHTRAG_DOC_CHUNKS",
|
@@ -1245,5 +1249,4 @@ SQL_TEMPLATES = {
|
|
1245 |
"drop_vdb_relation": """
|
1246 |
DROP TABLE IF EXISTS LIGHTRAG_VDB_RELATION CASCADE;
|
1247 |
""",
|
1248 |
-
|
1249 |
}
|
|
|
307 |
"""Drop the storage"""
|
308 |
drop_sql = SQL_TEMPLATES["drop_all"]
|
309 |
await self.db.execute(drop_sql)
|
310 |
+
|
311 |
+
|
312 |
@final
|
313 |
@dataclass
|
314 |
class PGVectorStorage(BaseVectorStorage):
|
|
|
550 |
},
|
551 |
)
|
552 |
return data
|
553 |
+
|
554 |
async def drop(self) -> None:
|
555 |
"""Drop the storage"""
|
556 |
drop_sql = SQL_TEMPLATES["drop_doc_full"]
|
557 |
await self.db.execute(drop_sql)
|
558 |
|
559 |
+
|
560 |
class PGGraphQueryException(Exception):
|
561 |
"""Exception for the AGE queries."""
|
562 |
|
|
|
1036 |
self, node_label: str, max_depth: int = 5
|
1037 |
) -> KnowledgeGraph:
|
1038 |
raise NotImplementedError
|
1039 |
+
|
1040 |
async def drop(self) -> None:
|
1041 |
"""Drop the storage"""
|
1042 |
drop_sql = SQL_TEMPLATES["drop_vdb_entity"]
|
|
|
1044 |
drop_sql = SQL_TEMPLATES["drop_vdb_relation"]
|
1045 |
await self.db.execute(drop_sql)
|
1046 |
|
1047 |
+
|
1048 |
NAMESPACE_TABLE_MAP = {
|
1049 |
NameSpace.KV_STORE_FULL_DOCS: "LIGHTRAG_DOC_FULL",
|
1050 |
NameSpace.KV_STORE_TEXT_CHUNKS: "LIGHTRAG_DOC_CHUNKS",
|
|
|
1249 |
"drop_vdb_relation": """
|
1250 |
DROP TABLE IF EXISTS LIGHTRAG_VDB_RELATION CASCADE;
|
1251 |
""",
|
|
|
1252 |
}
|