Download backend/sql_loader.py from lucharo/etymology: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/lucharo/etymology/resolve/main/backend/sql_loader.py
- Command line
-
hf download hf://spaces/lucharo/etymology/backend/sql_loader.py
-
curl -L -o sql_loader.py https://huggingface.co/spaces/lucharo/etymology/resolve/main/backend/sql_loader.py
457 Bytes
| """Load SQL files from the backend/sql/ directory.""" | |
| from __future__ import annotations | |
| from functools import cache | |
| from pathlib import Path | |
| SQL_DIR = Path(__file__).parent / "sql" | |
| def load_sql(filename: str) -> str: | |
| """Read and cache a SQL file from backend/sql/. | |
| Args: | |
| filename: Relative path within the sql/ directory, | |
| e.g. "queries/find_start_word.sql" | |
| """ | |
| return (SQL_DIR / filename).read_text() | |