Spaces:
Sleeping
Sleeping
File size: 495 Bytes
8c64ff3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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)
|