Files
PastpaperMaster/backend/app/services/supabase_client.py
Zhao 7a09167261 Initial commit: PastPaper Master full stack
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 12:27:47 +07:00

14 lines
369 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from supabase import create_client, Client
from app.config import get_settings
_client: Client | None = None
def get_supabase() -> Client:
"""获取 Supabase client (service_role绕过 RLS)"""
global _client
if _client is None:
s = get_settings()
_client = create_client(s.supabase_url, s.supabase_service_role_key)
return _client