Show db table versions

This commit is contained in:
Yiorgis Gozadinos 2025-09-23 12:44:05 +03:00
parent c0de22c9cd
commit 5369bd5dda
No known key found for this signature in database
2 changed files with 19 additions and 0 deletions

View file

@ -139,6 +139,7 @@ Shows:
- stored haiku.rag version (from settings)
- embeddings provider/model and vector dimension
- number of documents
- table versions per table (documents, chunks)
At the end, a separate “Versions” section lists runtime package versions:
- haiku.rag

View file

@ -90,6 +90,18 @@ class HaikuRAGApp:
docs_tbl = db.open_table("documents")
num_docs = int(docs_tbl.count_rows()) # type: ignore[attr-defined]
# Table versions per table (direct API)
doc_versions = (
len(list(db.open_table("documents").list_versions()))
if "documents" in table_names
else 0
)
chunk_versions = (
len(list(db.open_table("chunks").list_versions()))
if "chunks" in table_names
else 0
)
self.console.print(
f" [repr.attrib_name]haiku.rag version (db)[/repr.attrib_name]: {stored_version}"
)
@ -108,6 +120,12 @@ class HaikuRAGApp:
self.console.print(
f" [repr.attrib_name]documents[/repr.attrib_name]: {num_docs}"
)
self.console.print(
f" [repr.attrib_name]versions (documents)[/repr.attrib_name]: {doc_versions}"
)
self.console.print(
f" [repr.attrib_name]versions (chunks)[/repr.attrib_name]: {chunk_versions}"
)
self.console.rule()
self.console.print("[bold]Versions[/bold]")
self.console.print(