
- 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
15 lines
253 B
Python
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()
|