Spaces:
Paused
Paused
Download src/opencode_api/core/supabase.py from AUXteam/opencode-api: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/spaces/AUXteam/opencode-api/resolve/139795750ece1c4050b591421939e682da08d550/src/opencode_api/core/supabase.py
- Command line
-
hf download hf://spaces/AUXteam/opencode-api@139795750ece1c4050b591421939e682da08d550/src/opencode_api/core/supabase.py
-
curl -L -o supabase.py https://huggingface.co/spaces/AUXteam/opencode-api/resolve/139795750ece1c4050b591421939e682da08d550/src/opencode_api/core/supabase.py
592 Bytes
| from typing import Optional | |
| from supabase import create_client, Client | |
| from .config import settings | |
| _client: Optional[Client] = None | |
| def get_client() -> Optional[Client]: | |
| global _client | |
| if _client is not None: | |
| return _client | |
| if not settings.supabase_url or not settings.supabase_service_key: | |
| return None | |
| _client = create_client( | |
| settings.supabase_url, | |
| settings.supabase_service_key | |
| ) | |
| return _client | |
| def is_enabled() -> bool: | |
| return settings.supabase_url is not None and settings.supabase_service_key is not None | |