Spaces:
Runtime error
Runtime error
Download database.py from LoreSandhu/MediAssist-AI: direct link, hf CLI and curl.
- Browser
- Download file 600 Bytes
-
https://huggingface.co/spaces/LoreSandhu/MediAssist-AI/resolve/main/database.py
- Command line
-
hf download hf://spaces/LoreSandhu/MediAssist-AI/database.py
-
curl -L -o database.py https://huggingface.co/spaces/LoreSandhu/MediAssist-AI/resolve/main/database.py
600 Bytes
| from supabase import create_client | |
| from dotenv import load_dotenv | |
| import os | |
| load_dotenv() | |
| SUPABASE_URL = os.getenv("SUPABASE_URL") | |
| SUPABASE_KEY = os.getenv("SUPABASE_KEY") | |
| supabase = create_client( | |
| SUPABASE_URL, | |
| SUPABASE_KEY | |
| ) | |
| def get_patient_by_phone(phone): | |
| result = ( | |
| supabase.table("patients") | |
| .select("*") | |
| .eq("phone", phone) | |
| .execute() | |
| ) | |
| return result.data | |
| def get_doctor_by_id(doctor_id): | |
| result = ( | |
| supabase.table("doctors") | |
| .select("*") | |
| .eq("id", doctor_id) | |
| .execute() | |
| ) | |
| return result.data |