feat: add user and post management with CRUD operations; include tests for functionality
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 10s

This commit is contained in:
stephen schuresko
2025-02-17 20:51:46 -05:00
parent 6c467d7999
commit db783891c8
10 changed files with 440 additions and 177 deletions

20
db.py Normal file
View File

@@ -0,0 +1,20 @@
from sqlalchemy import create_engine, Column, Integer,String, ForeignKey
from sqlalchemy.engine import URL
from sqlalchemy.orm import sessionmaker, Session, declarative_base
# Database setup
DATABASE_URL = "sqlite:///./test.db"
engine = create_engine(DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = declarative_base()
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()