Spaces:
Paused
Paused
Download scratch/test_db.py from paras9909/opticparse-python: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/paras9909/opticparse-python/resolve/main/scratch/test_db.py
- Command line
-
hf download hf://spaces/paras9909/opticparse-python/scratch/test_db.py
-
curl -L -o test_db.py https://huggingface.co/spaces/paras9909/opticparse-python/resolve/main/scratch/test_db.py
702 Bytes
| import os | |
| import psycopg2 | |
| DATABASE_URL = "postgresql://postgres.xxmvhvxeglsjbewlouqg:9876607718Ppp@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres" | |
| print("Trying direct connection...") | |
| try: | |
| conn = psycopg2.connect(DATABASE_URL) | |
| print("Success!") | |
| conn.close() | |
| except Exception as e: | |
| print("Failed direct:", e) | |
| # Let's try without pooler (direct connection on 5432) | |
| DIRECT_URL = "postgresql://postgres.xxmvhvxeglsjbewlouqg:9876607718Ppp@db.xxmvhvxeglsjbewlouqg.supabase.co:5432/postgres" | |
| print("\nTrying direct connection on 5432...") | |
| try: | |
| conn = psycopg2.connect(DIRECT_URL) | |
| print("Success!") | |
| conn.close() | |
| except Exception as e: | |
| print("Failed direct 5432:", e) | |