Spaces:
Sleeping
Sleeping
Download app/core/database.py from D4rkbyte/tuklascope-api: direct link, hf CLI and curl.
- Browser
- Download file 581 Bytes
-
https://huggingface.co/spaces/D4rkbyte/tuklascope-api/resolve/main/app/core/database.py
- Command line
-
hf download hf://spaces/D4rkbyte/tuklascope-api/app/core/database.py
-
curl -L -o database.py https://huggingface.co/spaces/D4rkbyte/tuklascope-api/resolve/main/app/core/database.py
581 Bytes
| from supabase import create_client, Client | |
| from app.core.config import settings | |
| def get_supabase_client() -> Client: | |
| """ | |
| Initializes and returns the Supabase client. | |
| Fails safely if the environment variables are missing. | |
| """ | |
| if not settings.SUPABASE_URL or not settings.SUPABASE_ANON_KEY: | |
| raise ValueError( | |
| "Supabase URL and Anon Key must be configured in .env") | |
| return create_client(settings.SUPABASE_URL, settings.SUPABASE_ANON_KEY) | |
| # Instantiate a global client to be imported by our services | |
| supabase_db = get_supabase_client() | |