Automated Action a9210ca8ed Create manga inventory API with FastAPI and SQLite
- Implemented CRUD operations for manga, authors, publishers, and genres
- Added search and filtering functionality
- Set up SQLAlchemy ORM with SQLite database
- Configured Alembic for database migrations
- Implemented logging with Loguru
- Added comprehensive API documentation
- Set up error handling and validation
- Added ruff for linting and formatting
2025-05-30 12:29:35 +00:00

15 lines
253 B
Python

from collections.abc import Generator
from app.db.session import SessionLocal
def get_db() -> Generator:
"""
Dependency for getting a database session.
"""
db = SessionLocal()
try:
yield db
finally:
db.close()