Spaces:
Sleeping
Sleeping
Download src/db.py from Pachidam/eqdp-brief: direct link, hf CLI and curl.
- Browser
- Download file 937 Bytes
-
https://huggingface.co/spaces/Pachidam/eqdp-brief/resolve/main/src/db.py
- Command line
-
hf download hf://spaces/Pachidam/eqdp-brief/src/db.py
-
curl -L -o db.py https://huggingface.co/spaces/Pachidam/eqdp-brief/resolve/main/src/db.py
937 Bytes
| """Pipeline data-store handles. | |
| Originally backed by Supabase Postgres; the project has since pivoted to a | |
| single DuckDB file at `data/eqdp.duckdb`. The pipeline call sites still | |
| import `get_supabase()` and use the supabase-py builder pattern — that | |
| keeps working because `src.store.DuckStore` exposes the same chain. | |
| `get_pg_conn()` is retained for legacy bulk-DDL paths (e.g. `scripts/db_push`) | |
| and now returns a raw DuckDB connection. | |
| """ | |
| from __future__ import annotations | |
| from typing import Any | |
| from .store import DuckStore, get_store | |
| def get_supabase() -> DuckStore: | |
| """Backwards-compatible name. Returns a DuckDB-backed store.""" | |
| return get_store() | |
| def get_pg_conn(*, autocommit: bool = False) -> Any: | |
| """Raw DuckDB connection. `autocommit` is accepted for API parity but is | |
| a no-op — DuckDB autocommits each statement by default.""" | |
| del autocommit | |
| return get_store().connect(read_only=False) | |