Spaces:
Runtime error
Runtime error
Download app/database/connection.py from Vinit006/EmailAgentwithMemory: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/Vinit006/EmailAgentwithMemory/resolve/4995bb4b5d2a5063f335e4debb8206cedbbb4c2f/app/database/connection.py
- Command line
-
hf download hf://spaces/Vinit006/EmailAgentwithMemory@4995bb4b5d2a5063f335e4debb8206cedbbb4c2f/app/database/connection.py
-
curl -L -o connection.py https://huggingface.co/spaces/Vinit006/EmailAgentwithMemory/resolve/4995bb4b5d2a5063f335e4debb8206cedbbb4c2f/app/database/connection.py
417 Bytes
| from sqlalchemy import create_engine | |
| from sqlalchemy.orm import sessionmaker, Session | |
| from app.core.config import settings | |
| DB_URL_FOR_SQL_AL=settings.DB_URL_FOR_SQL_AL | |
| engine = create_engine( | |
| DB_URL_FOR_SQL_AL, | |
| echo=False, | |
| pool_pre_ping=True, | |
| pool_recycle=1800 | |
| ) | |
| SessionLocal = sessionmaker(bind=engine, autoflush=False, autocommit=False) | |
| def get_session() -> Session: | |
| return SessionLocal() |