gacha-bot2 / debug.py
Amit
Clean Cloud Deployment
732ca45
Raw
History Blame Contribute Delete
940 Bytes
import asyncio
import asyncpg
import traceback
from config import DB_DSN
async def run_debug():
if not DB_DSN:
print("\n🚨 CRITICAL ERROR: DB_DSN is empty!")
print("Your bot cannot find your PostgreSQL connection string in the .env file.")
return
print("πŸ”— Connecting to PostgreSQL using your config.py...")
try:
conn = await asyncpg.connect(DB_DSN)
print("βœ… Connection successful! Reading sql/schema.sql...")
with open("sql/schema.sql", "r") as f:
sql_text = f.read()
print("πŸš€ Executing schema.sql...")
await conn.execute(sql_text)
print("πŸŽ‰ SUCCESS! Your tables are built.")
await conn.close()
except Exception as e:
print("\n" + "="*50)
print("🚨 FULL UNCENSORED SQL ERROR 🚨")
print("="*50)
traceback.print_exc()
asyncio.run(run_debug())