f6fcaaeccc
Add a guided database configuration wizard and a data migration tool that allows users to: - Build database connection strings through a step-by-step UI - Test database connections before applying - Preview and execute data migrations from SQLite to PostgreSQL/MySQL - Copy to clipboard for easy .env file updates New files: - app/utils/db_wizard.py — connection string builder, parser, and tester - app/utils/db_migrate.py — table-by-table data migration utility - app/api/database.py — REST API endpoints for wizard operations - app/views/db_wizard.py — view route for the wizard page - frontend/templates/db_wizard.html — multi-tab wizard UI - tests/test_db_wizard.py — unit tests for db_wizard utilities - tests/test_db_migrate.py — unit tests for db_migrate utilities - tests/test_db_wizard_api.py — integration tests for API and views Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
29 lines
694 B
Python
29 lines
694 B
Python
"""
|
|
Database configuration wizard view.
|
|
|
|
Serves the guided UI for configuring a database connection string
|
|
and migrating data from one database to another.
|
|
"""
|
|
|
|
import logging
|
|
|
|
from fastapi import Request
|
|
|
|
from app.config import settings
|
|
from app.views.base import APIRouter, templates
|
|
|
|
logger = logging.getLogger(__name__)
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/database-wizard")
|
|
async def database_wizard(request: Request) -> templates.TemplateResponse:
|
|
"""Render the database configuration wizard page."""
|
|
return templates.TemplateResponse(
|
|
"db_wizard.html",
|
|
{
|
|
"request": request,
|
|
"current_database_url": settings.database_url,
|
|
},
|
|
)
|