fixed bugs

This commit is contained in:
belviskhoremk
2026-02-22 23:46:16 +00:00
parent 88ca23adde
commit 6fc607e32c
7 changed files with 195 additions and 10 deletions

25
app/database.py Normal file
View File

@@ -0,0 +1,25 @@
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,
)