This commit is contained in:
Waylon S. Walker 2024-12-11 09:17:38 -06:00
parent a70c24398a
commit e181f57a91
30 changed files with 2458 additions and 197 deletions

View file

@ -1,5 +1,7 @@
import alembic
import typer
import uvicorn
from alembic.config import Config
from rich.console import Console
from htmx_patterns.config import get_config
@ -7,7 +9,6 @@ from htmx_patterns.config import get_config
api_app = typer.Typer()
@api_app.callback()
def api():
"model cli"
@ -37,6 +38,10 @@ def run(
):
config = get_config(env)
Console().print(config.api_server)
Console().print(config.database_url)
alembic_cfg = Config("alembic.ini")
alembic_cfg.set_main_option("sqlalchemy.url", config.database_url)
alembic.command.upgrade(config=alembic_cfg, revision=alembic_revision)
uvicorn.run(**config.api_server.dict())