hydromodpy.results.catalog.cross_db#

Cross-DB helpers federating the project catalog with the data cache.

Two read-only joins are exposed:

  • run_input_entries(): cache entries referenced by a sim_id through the tracked_files table (joined on sha256).

  • entry_used_by(): simulations that referenced a given cache entry via the same SHA-256 bridge.

Both rely on a strictly read-only DuckDB ATTACH: the secondary database is opened, queried, and detached for every call. The invariant “three DuckDB scopes, never physically merged” stays intact.

Functions

entry_used_by(cache, *, sha256, catalog_paths)

Return sim_ids that consumed the cache entry identified by sha256.

resolve_cache_db_path(catalog)

Return the path of the workspace cache DB next to catalog.

run_input_entries(catalog, sim_id)

Return cache entries consumed by sim_id via the SHA-256 bridge.