Automated Action e01f6aaf16 Fix linting issues and finalize User Authentication Service
- Removed unused imports in deps.py, routes/auth.py, and models/user.py
- Code is now lint-free and follows best practices
- Complete FastAPI user authentication service with JWT token support

generated with BackendIM... (backend.im)
2025-05-14 09:46:58 +00:00

21 lines
501 B
Python

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from app.core.config import settings
engine = create_engine(
settings.SQLALCHEMY_DATABASE_URL,
connect_args={"check_same_thread": False} # for SQLite only
)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()