diff --git a/app/autogen/__init__.py b/app/autogen/__init__.py index 8269fd8..e75382a 100644 --- a/app/autogen/__init__.py +++ b/app/autogen/__init__.py @@ -1,2 +1,8 @@ # Code generated by APSO CLI. DO NOT EDIT. # This file is auto-generated - any changes will be overwritten. +from fastapi import APIRouter + +# `apso generate` replaces this with a router that includes every entity. +autogen_router = APIRouter(prefix="/api") + +__all__ = ["autogen_router"] diff --git a/app/main.py b/app/main.py index f22b83b..8d2aa9b 100644 --- a/app/main.py +++ b/app/main.py @@ -52,11 +52,11 @@ async def api_root(): return {"message": "APSO API", "version": "1.0.0"} -# Import and include autogen routers -# Entity routers will be registered here by the APSO CLI -# Example: -# from app.autogen.routers import organization, user -# app.include_router(organization.router, prefix="/api/organizations", tags=["Organizations"]) +# Routes generated from .apsorc (`apso generate` writes app/autogen). +# Include your own routers before this one to override a generated route. +from app.autogen import autogen_router # noqa: E402 + +app.include_router(autogen_router) if __name__ == "__main__": diff --git a/pyproject.toml b/pyproject.toml index 4f43b80..2991092 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ authors = [ dependencies = [ "fastapi>=0.109.0", "uvicorn[standard]>=0.27.0", - "sqlalchemy>=2.0.25", + "sqlalchemy[asyncio]>=2.0.25", "asyncpg>=0.29.0", "alembic>=1.13.1", "pydantic>=2.5.3",