db_path = context.get_x_argument(as_dictionary=True).get('dbPath')
if db_path:
    ini_section['sqlalchemy.url'] = db_path
connectable = engine_from_config(iniSection, prefix='sqlalchemy.',
    poolclass=pool.NullPool)
Using Alembic API from inside application code