whitesns-api / database.py
Nyanpre's picture
Upload 4 files
8c64ff3 verified
raw
history blame contribute delete
495 Bytes
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)