Spaces:
Sleeping
Sleeping
| import os | |
| from dotenv import load_dotenv | |
| from supabase import create_client, Client | |
| # `.env`ファイルをロード | |
| load_dotenv() | |
| # 環境変数から設定値を取得 | |
| url: str = os.getenv("SUPABASE_URL", "") | |
| key: str = os.getenv("SUPABASE_KEY", "") | |
| def get_db() -> Client: | |
| """Supabaseのクライアントインスタンスを返す""" | |
| if not url or not key: | |
| print("Warning: Supabase credentials are not set in .env") | |
| return None | |
| return create_client(url, key) | |