INNER CODE UNIT · Python

Init

fastapi-practices/fba-slim · backend/cli.py:566

class Init:
    auto: Annotated[
        bool,
        cappa.Arg(default=False, help='自动化初始化模式:自动创建 .env、安装依赖、创建数据库并初始化表结构'),
    ]

    async def __call__(self) -> None:
        if self.auto:
            await auto_init()
        else:
            async with async_db_session.begin() as db:
                await init(db, redis_client)


@cappa.command(help='运行 API 服务', default_long=True)
@dataclass
class Run:
    host: Annotated[

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…