File size: 710 Bytes
4f1c462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# test_db.py
import database

print("--- Testing Database Connection ---")

# Use a dummy user ID and username for the test
test_user_id = 12345
test_username = "testuser"

print(f"Attempting to get or create user: {test_user_id} ({test_username})")
user_data = database.get_or_create_user(test_user_id, test_username)

if user_data:
    print("\n✅ Test successful!")
    print("Received user data:")
    print(user_data)
    print("\nCheck your 'users' table in the Supabase dashboard. You should see a new entry for 'testuser'.")
else:
    print("\n❌ Test failed. Please check the error messages above.")
    print("Common issues include incorrect URL/Key in config.py or network connectivity problems.")