Example #1
0
def app(loop):
    return loop.run_until_complete(build_application())
Example #2
0
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)

# add your model's MetaData object here
# for 'autogenerate' support
# from models import mymodel
# target_metadata = mymodel.Base.metadata
# target_metadata = None
loop = asyncio.get_event_loop()
app = loop.run_until_complete(build_application())
target_metadata = app.db.Base.metadata

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.
config.set_main_option(
    'sqlalchemy.url',
    "postgresql://{}:{}@{}/{}".format(DATABASE['user'], DATABASE['password'],
                                      DATABASE['host'], DATABASE['database']))


def exclude_tables_from_config(config):
    tables = config.get('tables', [])
    if tables: