Esempio n. 1
0
def init_session_from_url(url):
    """
    Init the environment, including binding qtools.model.Session,
    using the specified connection URL.
    """
    engine = create_engine(url)
    init_model(engine)
    return engine
Esempio n. 2
0
def init_session_from_config(config_path):
    """
    Init the environment, including binding qtools.model.Session,
    using the specified config file.  The config should have sqlalchemy
    parameters in the [DEFAULT] section.
    """
    engine = get_engine_from_config(config_path)
    init_model(engine)
    return engine # for optional daisychain