Skip to content

Coroutines inside revision #1156

Closed Answered by zzzeek
Niccolum asked this question in Usage Questions
Jan 12, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

if you are using the async env.py template at https://github.com/sqlalchemy/alembic/blob/main/alembic/templates/async/env.py, which will establish SQLAlchemy's async "greenlet context" around everything that's running, you can run coroutines as:

from sqlalchemy.util import await_only

def upgrade():
    await_only(my_coroutine())

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Niccolum
Comment options

@Niccolum
Comment options

Answer selected by Niccolum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants