Automated Action 73b706f0eb Set up Solana Arbitrage Trading System
- Created Alembic migrations for SQLite database
- Set up database initialization on app startup
- Fixed linting issues with Ruff
- Updated README with comprehensive documentation
- Configured startup tasks and health checks
2025-06-05 19:34:12 +00:00

19 lines
443 B
Python

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from app.core.config import settings
engine = create_engine(
settings.SQLALCHEMY_DATABASE_URL,
connect_args={"check_same_thread": False}
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
def get_db():
"""Dependency for getting DB session"""
db = SessionLocal()
try:
yield db
finally:
db.close()