INNER CODE UNIT · Python

run_migrations_online

rafsaf/minimal-fastapi-postgres-template · alembic/env.py:69

async def run_migrations_online() -> None:
    """Run migrations in 'online' mode.

    In this scenario we need to create an Engine
    and associate a connection with the context.

    """
    configuration = config.get_section(config.config_ini_section)
    assert configuration
    configuration["sqlalchemy.url"] = get_database_uri()
    connectable = AsyncEngine(
        engine_from_config(
            configuration,
            prefix="sqlalchemy.",
            poolclass=pool.NullPool,
            future=True,
        )
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…