final commit

This commit is contained in:
Newzy Developer committed 2026-10-30 12:10:49 +00:00
1 parent 0ffbba3bed
commit 7b242b8685
39 files changed
+5524 -65

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
"""
Database utilities for authentication.
"""
from sqlalchemy.orm import Session
from .models import Base
def utcnow():
"""Return current UTC timestamp for database columns."""
from datetime import datetime
return datetime.utcnow()
def get_db() -> Session:
"""
Dependency factory that yields a database session.
Should be imported and used with Depends(get_db) in endpoint functions.
"""
from db.session import SessionLocal
db = SessionLocal()
try:
yield db
finally:
db.close()