Addded drop to postgresql
This commit is contained in:
@@ -301,6 +301,10 @@ class PGKVStorage(BaseKVStorage):
|
|||||||
# PG handles persistence automatically
|
# PG handles persistence automatically
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
async def drop(self) -> None:
|
||||||
|
"""Drop the storage"""
|
||||||
|
drop_sql = SQL_TEMPLATES["DROP_ALL"]
|
||||||
|
await self.db.execute(drop_sql)
|
||||||
|
|
||||||
@final
|
@final
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -1194,4 +1198,12 @@ SQL_TEMPLATES = {
|
|||||||
FROM LIGHTRAG_DOC_CHUNKS where workspace=$1)
|
FROM LIGHTRAG_DOC_CHUNKS where workspace=$1)
|
||||||
WHERE distance>$2 ORDER BY distance DESC LIMIT $3
|
WHERE distance>$2 ORDER BY distance DESC LIMIT $3
|
||||||
""",
|
""",
|
||||||
|
#DROP everything
|
||||||
|
"drop": """
|
||||||
|
DROP TABLE IF EXISTS LIGHTRAG_DOC_FULL CASCADE;
|
||||||
|
DROP TABLE IF EXISTS LIGHTRAG_DOC_CHUNKS CASCADE;
|
||||||
|
DROP TABLE IF EXISTS LIGHTRAG_LLM_CACHE CASCADE;
|
||||||
|
DROP TABLE IF EXISTS LIGHTRAG_VDB_ENTITY CASCADE;
|
||||||
|
DROP TABLE IF EXISTS LIGHTRAG_VDB_RELATION CASCADE;
|
||||||
|
""",
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user