- Add SQLAlchemy models for User, Translation, ApiKey, UsageLog, PaymentHistory - Add database connection management with PostgreSQL/SQLite support - Add repository layer for CRUD operations - Add Alembic migration setup with initial migration - Update auth_service to automatically use database when DATABASE_URL is set - Update docker-compose.yml with PostgreSQL service and Redis (non-optional) - Add database migration script (scripts/migrate_to_db.py) - Update .env.example with database configuration
18 lines
389 B
Python
18 lines
389 B
Python
"""
|
|
Database module for the Document Translation API
|
|
Provides PostgreSQL support with async SQLAlchemy
|
|
"""
|
|
from database.connection import get_db, engine, SessionLocal, init_db
|
|
from database.models import User, Subscription, Translation, ApiKey
|
|
|
|
__all__ = [
|
|
"get_db",
|
|
"engine",
|
|
"SessionLocal",
|
|
"init_db",
|
|
"User",
|
|
"Subscription",
|
|
"Translation",
|
|
"ApiKey"
|
|
]
|