mirror of
http://88.130.71.182:3000/BlitTech/contexta_be.git
synced 2026-06-13 08:45:24 +00:00
26 lines
605 B
Python
26 lines
605 B
Python
from supabase import create_client, Client
|
|
from app.config import settings
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
_supabase_client: Client = None
|
|
|
|
|
|
def get_supabase() -> Client:
|
|
global _supabase_client
|
|
if _supabase_client is None:
|
|
_supabase_client = create_client(
|
|
settings.supabase_url,
|
|
settings.supabase_service_role_key,
|
|
)
|
|
return _supabase_client
|
|
|
|
|
|
def get_supabase_anon() -> Client:
|
|
"""For user-scoped operations (respects RLS)"""
|
|
return create_client(
|
|
settings.supabase_url,
|
|
settings.supabase_anon_key,
|
|
)
|