Show db table versions
This commit is contained in:
parent
c0de22c9cd
commit
5369bd5dda
2 changed files with 19 additions and 0 deletions
|
|
@ -139,6 +139,7 @@ Shows:
|
||||||
- stored haiku.rag version (from settings)
|
- stored haiku.rag version (from settings)
|
||||||
- embeddings provider/model and vector dimension
|
- embeddings provider/model and vector dimension
|
||||||
- number of documents
|
- number of documents
|
||||||
|
- table versions per table (documents, chunks)
|
||||||
|
|
||||||
At the end, a separate “Versions” section lists runtime package versions:
|
At the end, a separate “Versions” section lists runtime package versions:
|
||||||
- haiku.rag
|
- haiku.rag
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,18 @@ class HaikuRAGApp:
|
||||||
docs_tbl = db.open_table("documents")
|
docs_tbl = db.open_table("documents")
|
||||||
num_docs = int(docs_tbl.count_rows()) # type: ignore[attr-defined]
|
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(
|
self.console.print(
|
||||||
f" [repr.attrib_name]haiku.rag version (db)[/repr.attrib_name]: {stored_version}"
|
f" [repr.attrib_name]haiku.rag version (db)[/repr.attrib_name]: {stored_version}"
|
||||||
)
|
)
|
||||||
|
|
@ -108,6 +120,12 @@ class HaikuRAGApp:
|
||||||
self.console.print(
|
self.console.print(
|
||||||
f" [repr.attrib_name]documents[/repr.attrib_name]: {num_docs}"
|
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.rule()
|
||||||
self.console.print("[bold]Versions[/bold]")
|
self.console.print("[bold]Versions[/bold]")
|
||||||
self.console.print(
|
self.console.print(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue