feat: add database configuration and health check
This commit is contained in:
parent
3d53a94d59
commit
3701c50711
9 changed files with 72 additions and 2 deletions
12
backend/hermes/app/db/health.py
Normal file
12
backend/hermes/app/db/health.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from sqlalchemy import text
|
||||
|
||||
from app.db.database import engine
|
||||
|
||||
|
||||
def check_database() -> bool:
|
||||
try:
|
||||
with engine.connect() as connection:
|
||||
connection.execute(text("SELECT 1"))
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
Loading…
Add table
Add a link
Reference in a new issue