Spaces:
Paused

MeloonTop / app /database.py
isold's picture
Add application file
f8553c9
Raw History Blame Contribute Delete
576 Bytes
import os
from dotenv import load_dotenv
from supabase import create_client, Client
load_dotenv()
SUPABASE_URL = os.getenv("SUPABASE_URL")
SUPABASE_KEY = os.getenv("SUPABASE_KEY")
if not SUPABASE_URL or not SUPABASE_KEY:
print("Warning: SUPABASE_URL and SUPABASE_KEY are not set in environment variables.")
# Create the Supabase client
# Ensure that the env vars are available before using the client
try:
supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
except Exception as e:
supabase = None
print(f"Error initializing Supabase client: {e}")