관리-도구
편집 파일: env.cpython-38.pyc
U 0?�fU � @ s� d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z e jZejdk r^eej� dZ dd�dd �Zedd �dd�Zdd�d d�Zdd�dd�Ze �� r�e� ne� dS )� N)� fileConfig)�pool)� Connection)�async_engine_from_config)�context)�returnc C s@ t �d�} tj| tdddid� t�� � t�� W 5 Q R X dS )aF Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don't even need a DBAPI to be available. Calls to context.execute() here emit the given string to the script output. zsqlalchemy.urlTZ paramstyle�named)�url�target_metadataZ literal_bindsZdialect_optsN)�configZget_main_optionr � configurer �begin_transaction�run_migrations)r � r �I/opt/hc_python/lib/python3.8/site-packages/alembic/templates/async/env.py�run_migrations_offline s � r )� connectionr c C s. t j| td� t �� � t �� W 5 Q R X d S )N)r r )r r r r r )r r r r �do_run_migrations7 s r c � s^ t t�tji �dtjd�} | �� 4 I dH �}|�t�I dH W 5 Q I dH R X | � � I dH dS )zcIn this scenario we need to create an Engine and associate a connection with the context. zsqlalchemy.)�prefixZ poolclassN) r r Zget_sectionZconfig_ini_sectionr ZNullPool�connectZrun_syncr Zdispose)Zconnectabler r r r �run_async_migrations>