baoxiang/backend/test_db.py
2025-12-16 18:06:50 +08:00

10 lines
336 B
Python

from app.core.database import engine
from sqlalchemy import text
try:
with engine.connect() as conn:
result = conn.execute(text('SELECT 1'))
print('Database connection test:', result.fetchone())
print('Database connection successful!')
except Exception as e:
print('Database connection failed:', str(e))