hydromodpy.results.catalog.views#

Materialised DuckDB views used by the catalog read path.

These views are installed by SimulationCatalog after the migration runner has applied the latest DDL. They expose denormalised projections of the v2 schema, joining the dimension tables (solvers, statuses, flow_regimes, mesh_topologies) so callers can keep using the familiar solver / status text labels without manually JOINing.

The DDL is written in a Postgres-compatible subset: no PIVOT, no MAP, no QUALIFY. Wide metric views are built via MAX(CASE WHEN ...) aggregation; wide parameter views are exposed as long-form v_params_long with a side helper view v_params_keyed that materialises the param_name / zone_id join key as a single column (so callers can pivot in pandas without touching SQL).

Functions

ensure_views(conn)

Create or replace the catalog summary views.