# Path: onefl/models/base.py
# def init(engine):
# def get_session():
# 
# Path: onefl/logutils.py
# CONFIG_FILE = 'config/logs.cfg'
# def get_figlet(name):
# def get_a_logger(name):


import sqlalchemy as db
from onefl.models import base
from onefl import logutils
    from urllib import parse
                        .format(db_type))
    return url


def get_db_engine(config):
    """
    @see http://docs.sqlalchemy.org/en/latest/core/connections.html
    """
    url = get_db_url(config)

    try:
        engine = db.create_engine(url,
                                  pool_size=10,
                                  max_overflow=5,
                                  pool_recycle=3600,
                                  echo=False)
    except TypeError as exc:
        log.warning("Got exc from db.create_engine(): {}".format(exc))
        engine = db.create_engine(url, echo=False)

    return engine


def get_db_session(engine, create_tables=False):
    """
    Connect to the database and return a Session object

    :param create_tables: boolean used to request table creation
    """
    log.debug("Call get_db_session()")

# Path: onefl/models/base.py
# def init(engine):
# def get_session():
# 
# Path: onefl/logutils.py
# CONFIG_FILE = 'config/logs.cfg'
# def get_figlet(name):
# def get_a_logger(name):


# Path: onefl/utils/db.py
import sqlalchemy as db
from onefl.models import base
from onefl import logutils
    from urllib import parse

                        .format(db_type))
    return url


def get_db_engine(config):
    """
    @see http://docs.sqlalchemy.org/en/latest/core/connections.html
    """
    url = get_db_url(config)

    try:
        engine = db.create_engine(url,
                                  pool_size=10,
                                  max_overflow=5,
                                  pool_recycle=3600,
                                  echo=False)
    except TypeError as exc:
        log.warning("Got exc from db.create_engine(): {}".format(exc))
        engine = db.create_engine(url, echo=False)

    return engine


def get_db_session(engine, create_tables=False):
    """
    Connect to the database and return a Session object

    :param create_tables: boolean used to request table creation
    """
    log.debug("Call get_db_session()")

    base.init(engine)