File size: 1,281 Bytes
b23ff00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

import os
from supabase import create_client

SUPABASE_URL = "https://mikrcsxkyggxjeaqyfaw.supabase.co"
SUPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im1pa3Jjc3hreWdneGplYXF5ZmF3Iiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc3MDQyNjQ1OCwiZXhwIjoyMDg2MDAyNDU4fQ.pX3hcJJUQwJa0YC88iy8NUhORDZbB44fgTojvbZZO7A"

print(f"1. Connecting to {SUPABASE_URL}...")
try:
    supabase = create_client(SUPABASE_URL, SUPABASE_KEY)
    print("   Connection object created.")
except Exception as e:
    print(f"   Connection FAILED: {e}")
    exit(1)

print("\n2. Testing Fetch (Pull Requests)...")
try:
    # Fetch just ONE row to test connectivity
    res = supabase.table("pull_requests").select("count", count="exact").limit(1).execute()
    print("   Success! Result:", res)
    if res.data:
        print(f"   Found data: {res.data[0]}")
    else:
        print("   Connection successful but returned NO data.")
except Exception as e:
    print(f"   Fetch FAILED: {e}")

print("\n3. Testing Fetch (Commits)...")
try:
    # Fetch just ONE row
    res = supabase.table("commits").select("count", count="exact").limit(1).execute()
    print("   Success! Result:", res)
except Exception as e:
    print(f"   Fetch FAILED: {e}")