Пример #1
0
def init_session_readonly_from_url(url):
    """
    Init the environment, including binding qtools.model.Session,
    using the specified connection URL.  The Session will be a
    read-only session.
    """
    engine = create_engine(url)
    init_model_readonly(engine)
    return engine
Пример #2
0
def init_session_readonly_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.  The Session will be a
    read-only session.
    """
    engine = get_engine_from_config(config_path)
    init_model_readonly(engine)
    return engine # for optional daisychain