File size: 660 Bytes
35709fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
from supabase import create_client
from dotenv import load_dotenv

load_dotenv()

url = os.environ.get("SUPABASE_URL")
key = os.environ.get("SUPABASE_SERVICE_ROLE_KEY")
supabase = create_client(url, key)

try:
    # Get an application with user and job relations
    res = supabase.table("applications").select("user_id, job_id").limit(1).execute()
    if res.data:
        app = res.data[0]
        # In this project, user_id might be the profile id
        print(f"Candidate ID (profile): {app['user_id']}")
        print(f"Job ID: {app['job_id']}")
    else:
        print("No applications found.")
except Exception as e:
    print(f"Error: {e}")