
- Set up project structure - Configure SQLAlchemy models and database connection - Set up Alembic for database migrations - Create Pydantic schemas for API data validation - Implement task CRUD operations - Add task filtering and pagination - Include health check endpoint - Update README with setup and usage instructions
14 lines
414 B
Python
14 lines
414 B
Python
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
from app.core.config import settings
|
|
|
|
# Ensure the database directory exists
|
|
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
engine = create_engine(
|
|
settings.SQLALCHEMY_DATABASE_URL,
|
|
connect_args={"check_same_thread": False} # Needed for SQLite
|
|
)
|
|
|
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) |