SPA_TemperProductionOverview/_db.py
Erik aa115a0b8d feat: scaffold Temper-Linie live-overview page-module (temper_overview)
Vue 3 + Vite 8 + TS + PrimeVue 4 (Nora/Industrial) + Pinia + vue-i18n SPA, served
by the SPRO gateway as a static page-module under /module/temper_overview and
embedded into Grafana via iframe.

- Ports the LOCKED design #4 "Shop-floor Schematic": one connected line
  Pressen -> (cyan) -> Ofen -> (green) -> Fertig; carts under their origin press;
  oven trays as dwell-progress bars; finished band; range picker scoping only the
  Fertig figures. Flow/order colours match PressV (fleet recognisability).
- Python page-module wrapper: register(app) mounts committed dist/ + a no-auth
  read API (GET /api/overview). Kernel DB seam in _db.py.
- Backend returns SAMPLE data; frontend falls back to bundled sample so `npm run
  dev` renders with zero backend (TODO markers point at the real temper aggregates).
- Rich README bakes in the design, contract, wiring + Grafana embedding for
  standalone development.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 20:41:04 +02:00

22 lines
958 B
Python

"""Kernel DB seam for the temper_overview page-module.
Mirrors ``modules/fastpress/press/_db.py``: the module reaches the database ONLY
through the gateway kernel's SELECT-only proxy, re-exported here so the coupling
to ``app.db`` lives in exactly one place. This page is read-only, so it needs
``run_select_query`` and nothing else (no ``transaction`` — it never writes).
The base scaffold's API (``api/routes.py``) returns SAMPLE data and does NOT import
this yet — wiring real SQL is the next step (see the TODO in ``api/routes.py``).
Keeping the seam here means that when the real query is added it imports::
from .._db import run_select_query
NOTE: no connection happens at import — SQLAlchemy's engine is lazy; the first
real connection opens only when a query actually executes.
"""
from __future__ import annotations
from app.db.mariadb import run_select_query # noqa: F401 (kernel SELECT-only proxy)
__all__ = ["run_select_query"]