Spaces:
Starting
Starting
Download app/supabase_client.py from espacodocente01/api: direct link, hf CLI and curl.
- Browser
- Download file 486 Bytes
-
https://huggingface.co/spaces/espacodocente01/api/resolve/main/app/supabase_client.py
- Command line
-
hf download hf://spaces/espacodocente01/api/app/supabase_client.py
-
curl -L -o supabase_client.py https://huggingface.co/spaces/espacodocente01/api/resolve/main/app/supabase_client.py
486 Bytes
| """Cliente Supabase singleton.""" | |
| from __future__ import annotations | |
| from functools import lru_cache | |
| from supabase import Client, create_client | |
| from .config import get_settings | |
| def get_client() -> Client: | |
| settings = get_settings() | |
| # service_key porque algumas operacoes (RPC ja eh public) podem precisar | |
| # de bypass de RLS no futuro; pra busca leitura ja seria possivel com anon | |
| return create_client(settings.supabase_url, settings.supabase_service_key) | |