"""Supabase client helpers — one anon client, one service-role client.""" from __future__ import annotations from functools import lru_cache from supabase import Client, create_client from app.core.config import get_settings @lru_cache def get_supabase_client() -> Client: """Public / anon client — respects RLS policies.""" s = get_settings() return create_client(s.SUPABASE_URL, s.SUPABASE_KEY) @lru_cache def get_supabase_admin() -> Client: """Service-role client — bypasses RLS. Use with care.""" s = get_settings() return create_client(s.SUPABASE_URL, s.SUPABASE_SERVICE_ROLE_KEY)