Desi-Clans/backend/app/services/health.py
2026-10-08 02:52:58 +05:30

11 lines
264 B
Python

from sqlalchemy import text
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import Session
def check_database(db: Session) -> bool:
try:
db.execute(text("SELECT 1"))
return True
except SQLAlchemyError:
return False