# 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.")