Simplify deleting all chunks

This commit is contained in:
Yiorgis Gozadinos 2025-09-02 15:13:31 +03:00
parent b73949c784
commit 75e878308e
No known key found for this signature in database

View file

@ -51,7 +51,6 @@ class ChunkRepository:
embedding = entity.embedding
else:
embedding = await self.embedder.embed(entity.content)
chunk_record = self.store.ChunkRecord(
id=chunk_id,
document_id=entity.document_id,
@ -179,14 +178,6 @@ class ChunkRepository:
async def delete_all(self) -> None:
"""Delete all chunks from the database."""
count = len(
list(
self.store.chunks_table.search()
.limit(1)
.to_pydantic(self.store.ChunkRecord)
)
)
if count > 0:
# Drop and recreate table to clear all data
self.store.db.drop_table("chunks")
self.store.chunks_table = self.store.db.create_table(