Files
ai-exchange/scripts/check_db.py
T
2026-04-24 13:39:01 +08:00

22 lines
446 B
Python

from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from sqlalchemy import text
from src.db.engine import engine
def main() -> None:
with engine.connect() as connection:
result = connection.execute(text("select 1"))
value = result.scalar_one()
print(f"database connection ok: {value}")
if __name__ == "__main__":
main()