Update postgres_impl.py
This commit is contained in:
@@ -307,7 +307,8 @@ class PGKVStorage(BaseKVStorage):
|
|||||||
"""Drop the storage"""
|
"""Drop the storage"""
|
||||||
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."""
|
||||||
|
|
||||||
@@ -1033,7 +1036,7 @@ class PGGraphStorage(BaseGraphStorage):
|
|||||||
self, node_label: str, max_depth: int = 5
|
self, node_label: str, max_depth: int = 5
|
||||||
) -> KnowledgeGraph:
|
) -> KnowledgeGraph:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
async def drop(self) -> None:
|
async def drop(self) -> None:
|
||||||
"""Drop the storage"""
|
"""Drop the storage"""
|
||||||
drop_sql = SQL_TEMPLATES["drop_vdb_entity"]
|
drop_sql = SQL_TEMPLATES["drop_vdb_entity"]
|
||||||
@@ -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;
|
||||||
""",
|
""",
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user