haiku.rag/tests/store
Yiorgis Gozadinos da207da106
Read the table list and settings once per open
Opening a database ran `list_tables` three times, opened the settings table
twice, and read and parsed the same settings row three times: once for the stored
vector dimension, once for the version behind the migration check, and once for
config validation. On object storage each of those is a round trip.

`_initialize` now reads both once and threads them down. `_init_tables` and
`_check_migrations` take what it read instead of fetching their own copy, and
`validate_config_compatibility` accepts the settings it should compare against,
still reading for itself when called directly.

Passing the pre-init read to validation is equivalent: nothing between the read
and the validation rewrites `embeddings`, which is all it compares.

The settings read no longer swallows every exception. It did before, when the
only consequence was falling back to the configured vector dimension; now the
same empty result feeds the migration check, where it would read as version
0.0.0 and declare every migration pending. Only decode failures are tolerated,
and a decoded non-object normalizes to {} rather than reaching callers that
expect a mapping.
2026-08-18 14:58:17 +03:00
..
__init__.py Split meta document attributes into a document_meta table 2026-06-12 10:17:17 +03:00
legacy_documents.py Serialize and roll back the multi-table document delete 2026-06-12 10:17:18 +03:00
test_citation.py Search results and citations carry document metadata 2026-07-23 10:23:48 +03:00
test_compression.py Collapse docling compression to a single function 2026-06-24 10:43:27 +03:00
test_database_info.py Extract gather_database_info shared by the info command 2026-06-09 11:09:28 +03:00
test_document_items.py Reach and enforce 100% coverage 2026-07-26 20:11:02 +03:00
test_document_meta_split.py Rename document_meta identity column document_id to id 2026-07-08 16:32:55 +03:00
test_engine.py Similar fix for haiku.rag.ingester, and formatting 2026-08-12 15:20:11 +01:00
test_indexes.py Trim comments, docstrings and docs to what they need to say 2026-08-18 12:38:02 +03:00
test_migrations.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_open_path.py Read the table list and settings once per open 2026-08-18 14:58:17 +03:00
test_read_only.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_restore.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_tags.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_v0_40_0_migration.py Similar fix for haiku.rag.ingester, and formatting 2026-08-12 15:20:11 +01:00
test_v0_45_0_migration.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_v0_48_0_migration.py Collapse docling compression to a single function 2026-06-24 10:43:27 +03:00
test_v0_50_0_migration.py Reach and enforce 100% coverage 2026-07-26 20:11:02 +03:00
test_v0_58_0_migration.py Load document blobs only when asked 2026-08-06 13:04:51 +03:00
test_v0_64_0_migration.py Rename document_meta identity column document_id to id 2026-07-08 16:32:55 +03:00
test_v0_75_0_migration.py Trim comments, docstrings and docs to what they need to say 2026-08-18 12:38:02 +03:00