11 lines
264 B
Python
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
|