# Path: boiler/feature/orm.py
# def orm_feature(app):
# 
# Path: boiler/bootstrap.py
# def get_config():
# def get_app():
# def test_import_name(name):
# def create_app(name, config=None, flask_params=None):
#     def detect_dev_proxy():
# def add_routing(app):
# def add_mail(app):
# def add_orm(app):
# def add_logging(app):
# def add_localization(app):


import click
from alembic import command as alembic_command
from alembic.util import CommandError
from boiler.cli.colors import *
from boiler.feature.orm import db
from boiler import bootstrap
    from boiler.migrations.config import MigrationsConfig



def get_config():
    """
    Prepare and return alembic config
    These configurations used to live in alembic config initialiser, but that
    just tight coupling. Ideally we should move that to userspace and find a
    way to pass these into alembic commands.

    @todo: think about it
    """

    # used for errors
    map = dict(
        path='MIGRATIONS_PATH',
        db_url='SQLALCHEMY_DATABASE_URI',
        metadata='SQLAlchemy metadata'
    )

    app = bootstrap.get_app()
    params = dict()
    params['path'] = app.config.get(map['path'], 'migrations')
    params['db_url'] = app.config.get(map['db_url'])

# Path: boiler/feature/orm.py
# def orm_feature(app):
# 
# Path: boiler/bootstrap.py
# def get_config():
# def get_app():
# def test_import_name(name):
# def create_app(name, config=None, flask_params=None):
#     def detect_dev_proxy():
# def add_routing(app):
# def add_mail(app):
# def add_orm(app):
# def add_logging(app):
# def add_localization(app):


# Path: boiler/cli/db.py
import click
from alembic import command as alembic_command
from alembic.util import CommandError
from boiler.cli.colors import *
from boiler.feature.orm import db
from boiler import bootstrap
    from boiler.migrations.config import MigrationsConfig




def get_config():
    """
    Prepare and return alembic config
    These configurations used to live in alembic config initialiser, but that
    just tight coupling. Ideally we should move that to userspace and find a
    way to pass these into alembic commands.

    @todo: think about it
    """

    # used for errors
    map = dict(
        path='MIGRATIONS_PATH',
        db_url='SQLALCHEMY_DATABASE_URI',
        metadata='SQLAlchemy metadata'
    )

    app = bootstrap.get_app()
    params = dict()
    params['path'] = app.config.get(map['path'], 'migrations')
    params['db_url'] = app.config.get(map['db_url'])

    params['metadata'] = db.metadata