当前位置: 首页>>代码示例>>Python>>正文


Python pool.NullPool方法代码示例

本文整理汇总了Python中sqlalchemy.pool.NullPool方法的典型用法代码示例。如果您正苦于以下问题:Python pool.NullPool方法的具体用法?Python pool.NullPool怎么用?Python pool.NullPool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sqlalchemy.pool的用法示例。


在下文中一共展示了pool.NullPool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix="sqlalchemy.",
        poolclass=pool.NullPool,
    )

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:HTTP-APIs,项目名称:hydrus,代码行数:22,代码来源:env.py

示例2: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    db_url = os.environ['DRYDOCK_DB_URL']

    connectable = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix='sqlalchemy.',
        poolclass=pool.NullPool,
        url=db_url)

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata)

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:airshipit,项目名称:drydock,代码行数:23,代码来源:env.py

示例3: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix="sqlalchemy.",
        poolclass=pool.NullPool,
        connect_args={'options': f'-c search_path={_app_config.POSTGRES_SCHEMA}'}
    )

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:everyclass,项目名称:everyclass-server,代码行数:23,代码来源:env.py

示例4: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    engine = engine_from_config(
                config.get_section(config.config_ini_section),
                prefix='sqlalchemy.',
                poolclass=pool.NullPool)

    connection = engine.connect()
    context.configure(
                connection=connection,
                target_metadata=target_metadata
                )

    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        connection.close() 
开发者ID:codeforamerica,项目名称:comport,代码行数:25,代码来源:env.py

示例5: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """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)
    configuration['sqlalchemy.url'] = os.environ['HAMMER_DATABASE_URL']
    connectable = engine_from_config(
        configuration,
        prefix="sqlalchemy.",
        poolclass=pool.NullPool,
    )

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:asharov,项目名称:git-hammer,代码行数:24,代码来源:env.py

示例6: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix='sqlalchemy.',
        poolclass=pool.NullPool)

    with connectable.connect() as connection:
        context.configure(
            connection=connection,
            target_metadata=target_metadata
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:lablup,项目名称:backend.ai-manager,代码行数:22,代码来源:env.py

示例7: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = create_engine(DBURL, poolclass=pool.NullPool)

    with connectable.connect() as connection:

        context.configure(
            connection=connection,
            target_metadata=target_metadata
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:Pagure,项目名称:pagure,代码行数:20,代码来源:env.py

示例8: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
	"""Run migrations in 'online' mode.

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

	"""
	connectable = engine_from_config(
		config.get_section(config.config_ini_section),
		prefix='sqlalchemy.',
		poolclass=pool.NullPool)

	with connectable.connect() as connection:
		context.configure(
			connection      = connection,
			target_metadata = target_metadata,
			include_object  = include_object,
			compare_type=True
		)

		with context.begin_transaction():
			context.run_migrations() 
开发者ID:fake-name,项目名称:ReadableWebProxy,代码行数:24,代码来源:env.py

示例9: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
	"""Run migrations in 'online' mode.

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

	"""
	engine = create_engine(
		database_connection_url,
		poolclass=pool.NullPool)

	connection = engine.connect()
	context.configure(
		connection=connection,
		target_metadata=target_metadata
	)

	try:
		with context.begin_transaction():
			context.run_migrations()
	finally:
		connection.close() 
开发者ID:rsmusllp,项目名称:king-phisher,代码行数:24,代码来源:env.py

示例10: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    engine = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix='sqlalchemy.',
        poolclass=pool.NullPool
    )

    connection = engine.connect()
    context.configure(
        connection=connection,
        target_metadata=target_metadata,
        compare_type=True
    )

    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        connection.close() 
开发者ID:RiotGames,项目名称:cloud-inquisitor,代码行数:27,代码来源:env.py

示例11: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    engine = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix="sqlalchemy.",
        poolclass=pool.NullPool,
    )

    connection = engine.connect()
    context.configure(
        connection=connection, target_metadata=target_metadata, compare_type=True
    )

    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        connection.close() 
开发者ID:SynoCommunity,项目名称:spkrepo,代码行数:19,代码来源:env.py

示例12: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix="sqlalchemy.",
        poolclass=pool.NullPool,
    )

    with connectable.connect() as connection:
        context.configure(connection=connection,
                          target_metadata=target_metadata)

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:lttkgp,项目名称:C-3PO,代码行数:21,代码来源:env.py

示例13: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    engine = create_engine(
        octavia_config.database.connection,
        poolclass=pool.NullPool)

    connection = engine.connect()
    context.configure(
        connection=connection,
        target_metadata=target_metadata)

    try:
        with context.begin_transaction():
            context.run_migrations()
    finally:
        connection.close() 
开发者ID:openstack,项目名称:octavia,代码行数:23,代码来源:env.py

示例14: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = engine_from_config(
        config.get_section(config.config_ini_section),
        prefix='sqlalchemy.',
        poolclass=pool.NullPool,
    )

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:item4,项目名称:yui,代码行数:22,代码来源:env.py

示例15: run_migrations_online

# 需要导入模块: from sqlalchemy import pool [as 别名]
# 或者: from sqlalchemy.pool import NullPool [as 别名]
def run_migrations_online():
    """Run migrations in 'online' mode.

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

    """
    connectable = getattr(config, 'connection', None)

    if connectable is None:
        connectable = engine_from_config(
            config.get_section(config.config_ini_section),
            prefix='sqlalchemy.',
            poolclass=pool.NullPool)

    with connectable.connect() as connection:
        context.configure(
            connection=connection,
            target_metadata=target_metadata,
            version_table=VERSION_TABLE
        )

        with context.begin_transaction():
            context.run_migrations() 
开发者ID:a10networks,项目名称:a10-neutron-lbaas,代码行数:26,代码来源:env.py


注:本文中的sqlalchemy.pool.NullPool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。