refactor: consolidate get_db into single module

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-09 15:37:23 +00:00
parent cd6fd95d50
commit 98cf9e0e0b
5 changed files with 6 additions and 30 deletions
-10
View File
@@ -9,21 +9,11 @@ from pathlib import Path
from fastapi import HTTPException, status
from app.config import settings
from app.database import SessionLocal
# Set up logging
logger = logging.getLogger(__name__)
def get_db():
"""Database dependency injection for routes"""
db = SessionLocal()
try:
yield db
finally:
db.close()
def resolve_file_path(file_path: str, subfolder: str = None) -> str:
"""
Resolves a file path to an absolute path with path traversal protection.