[Python] How to debug Alembic migrations inside VS Code?

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    Say I have a migration script like this one:

    # revision identifiers, used by Alembic.
    revision = 'b5c9e0aac59b'
    down_revision = '4658d3e26bae'
    branch_labels = None
    depends_on = None

    def upgrade():
    print("hello world!")


    And I want to place a breakpoint on the line that contains the print statement.

    How can I configure VS Code to launch the command alembic -n sandbox upgrade b5c9e0aac59b (or python -m alembic -n sandbox upgrade b5c9e0aac59b), and use VS Code debugging features?

    Continue reading...

Compartilhe esta Página