LearningnRunning's picture
feat: Integrate Supabase for data management, replacing local PostgreSQL. Implement Supabase service for CRUD operations on patients and scenarios, and update application logic to utilize Supabase API. Add Dockerfile for containerization and .dockerignore for build optimization.
3a338e5
raw
history blame contribute delete
929 Bytes
"""
Supabase μ‹œλ‚˜λ¦¬μ˜€ 데이터 λ‘œλ“œ 슀크립트
"""
from services.supabase_service import SupabaseService
from config.database import supabase_client
if __name__ == "__main__":
print("πŸš€ Supabase μ‹œλ‚˜λ¦¬μ˜€ 데이터 λ‘œλ“œ μ‹œμž‘...")
if not supabase_client:
print("❌ Supabase ν΄λΌμ΄μ–ΈνŠΈκ°€ μ΄ˆκΈ°ν™”λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.")
print(" ν™˜κ²½ λ³€μˆ˜ SUPABASE_URLκ³Ό SUPABASE_ANON_KEYλ₯Ό ν™•μΈν•˜μ„Έμš”.")
exit(1)
# Supabase μ„œλΉ„μŠ€ μ΄ˆκΈ°ν™”
supabase_service = SupabaseService()
# μ‹œλ‚˜λ¦¬μ˜€ 데이터 λ‘œλ“œ
print("\nπŸ“₯ μ‹œλ‚˜λ¦¬μ˜€ 데이터 λ‘œλ“œ 쀑...")
try:
supabase_service.load_scenarios_from_json("data/scenarios.json")
print("\nβœ… λͺ¨λ“  μ΄ˆκΈ°ν™” μž‘μ—…μ΄ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€!")
except Exception as e:
print(f"\n❌ 였λ₯˜ λ°œμƒ: {e}")
import traceback
traceback.print_exc()