diff --git a/haiku_rag_slim/haiku/rag/inspector/widgets/info_modal.py b/haiku_rag_slim/haiku/rag/inspector/widgets/info_modal.py index 96013434..4621c0e3 100644 --- a/haiku_rag_slim/haiku/rag/inspector/widgets/info_modal.py +++ b/haiku_rag_slim/haiku/rag/inspector/widgets/info_modal.py @@ -79,7 +79,7 @@ class InfoModal(ModalScreen): # Connect to get table info try: db = lancedb.connect(self.db_path) - table_names = set(db.table_names()) + table_names = set(db.list_tables().tables) except Exception as e: lines.append(f"[red]Failed to open database: {e}[/red]") self._content_widget.update("\n".join(lines)) diff --git a/haiku_rag_slim/haiku/rag/store/engine.py b/haiku_rag_slim/haiku/rag/store/engine.py index 28bb0b62..aeb6748a 100644 --- a/haiku_rag_slim/haiku/rag/store/engine.py +++ b/haiku_rag_slim/haiku/rag/store/engine.py @@ -153,7 +153,7 @@ class Store: The stored vector dimension, or None if not found. """ try: - existing_tables = self.db.table_names() + existing_tables = self.db.list_tables().tables if "settings" not in existing_tables: return None @@ -333,7 +333,7 @@ class Store: def _init_tables(self): """Initialize database tables (create if they don't exist).""" - existing_tables = self.db.table_names() + existing_tables = self.db.list_tables().tables required_tables = {"documents", "chunks", "settings"} missing_tables = required_tables - set(existing_tables) diff --git a/haiku_rag_slim/haiku/rag/store/upgrades/v0_25_0.py b/haiku_rag_slim/haiku/rag/store/upgrades/v0_25_0.py index c46351d0..9e49b853 100644 --- a/haiku_rag_slim/haiku/rag/store/upgrades/v0_25_0.py +++ b/haiku_rag_slim/haiku/rag/store/upgrades/v0_25_0.py @@ -88,7 +88,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover if not ids: # Check if there's a staging table from a failed migration to recover from - if "documents_v4_staging" in store.db.table_names(): + if "documents_v4_staging" in store.db.list_tables().tables: staging_table = store.db.open_table("documents_v4_staging") staging_ids = [ row["id"] @@ -100,7 +100,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover ) # Create new documents table and copy from staging store.documents_table = None - if "documents" in store.db.table_names(): + if "documents" in store.db.list_tables().tables: store.db.drop_table("documents") store.documents_table = store.db.create_table( "documents", schema=get_documents_arrow_schema_v4() @@ -142,7 +142,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover # No documents and no staging to recover, just recreate table with new schema store.documents_table = None - if "documents" in store.db.table_names(): + if "documents" in store.db.list_tables().tables: store.db.drop_table("documents") store.documents_table = store.db.create_table( "documents", schema=get_documents_arrow_schema_v4() @@ -150,7 +150,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover return # Create staging table with new schema - if "documents_v4_staging" in store.db.table_names(): + if "documents_v4_staging" in store.db.list_tables().tables: store.db.drop_table("documents_v4_staging") staging_table = store.db.create_table( "documents_v4_staging", schema=get_documents_arrow_schema_v4() @@ -185,7 +185,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover # Replace old table with staging table store.documents_table = None - if "documents" in store.db.table_names(): + if "documents" in store.db.list_tables().tables: store.db.drop_table("documents") store.documents_table = store.db.create_table( "documents", schema=get_documents_arrow_schema_v4() @@ -225,7 +225,7 @@ def _apply_compress_docling_document(store: Store) -> None: # pragma: no cover logger.info("Copied batch %d/%d", batch_num, total_batches) # Cleanup staging table - if "documents_v4_staging" in store.db.table_names(): + if "documents_v4_staging" in store.db.list_tables().tables: store.db.drop_table("documents_v4_staging") # Vacuum all tables (destructive migration, no history preserved)