Skip to content

Feature Request: Add Async Setup Support #1

@ppinklesh

Description

@ppinklesh

Add an option in the project creation flow to enable async setup.
During the CLI prompts, users should be asked whether they want to generate a project with async support or the regular sync setup.
By default, the project should remain synchronous, but users can opt-in for async when prompted.


Expected Behavior

When running:

fastapi-create-project

The CLI should include a prompt like:

Do you want to use async setup? (y/N):

If the user selects yes, generate the project using:

  • sqlalchemy.ext.asyncio (create_async_engine, AsyncSession, async_sessionmaker)
  • Async-compatible database drivers (asyncpg, aiosqlite)
  • Async CRUD operations and routes using async def and await

If the user selects no, generate the current synchronous setup.


Implementation Notes

  • Add a new prompt in the CLI workflow (questionary / click / whichever CLI library used).
  • Introduce a flag internally (e.g. use_async=True|False).
  • Adjust database and CRUD templates accordingly.
  • Update dependencies to install async drivers only if async setup is chosen.
  • Update README and generated project docs.

Acceptance Criteria

  • CLI prompts user whether to enable async setup.
  • Default behavior remains synchronous (if user presses Enter).
  • Async setup scaffolds correctly when chosen.
  • Async drivers installed conditionally.
  • Documentation updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions