'This callback can be used to initialize an application for the
use with this database setup.  Never use a database in the context
of an application not initialized that way or connections will
leak.'

def init_app(self, app):

    if ('SQLALCHEMY_DATABASE_URI' not in app.config):
        warnings.warn('SQLALCHEMY_DATABASE_URI    not    set.    Defaulting    to    "sqlite:///:memory:".')
    app.config.setdefault('SQLALCHEMY_DATABASE_URI', 'sqlite:///:memory:')
    app.config.setdefault('SQLALCHEMY_BINDS', None)
    app.config.setdefault('SQLALCHEMY_NATIVE_UNICODE', None)
    app.config.setdefault('SQLALCHEMY_ECHO', False)
    app.config.setdefault('SQLALCHEMY_RECORD_QUERIES', None)
    app.config.setdefault('SQLALCHEMY_POOL_SIZE', None)
    app.config.setdefault('SQLALCHEMY_POOL_TIMEOUT', None)
    app.config.setdefault('SQLALCHEMY_POOL_RECYCLE', None)
    app.config.setdefault('SQLALCHEMY_MAX_OVERFLOW', None)
    app.config.setdefault('SQLALCHEMY_COMMIT_ON_TEARDOWN', False)
    track_modifications = app.config.setdefault('SQLALCHEMY_TRACK_MODIFICATIONS', None)
    if (track_modifications is None):
        warnings.warn(FSADeprecationWarning('SQLALCHEMY_TRACK_MODIFICATIONS    adds    significant    overhead    and    will    be    disabled    by    default    in    the    future.        Set    it    to    True    or    False    to    suppress    this    warning.'))
    app.extensions['sqlalchemy'] = _SQLAlchemyState(self)
    @app.teardown_appcontext
    def shutdown_session(response_or_exc):
        if app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN']:
            if (response_or_exc is None):
                self.session.commit()
        self.session.remove()
        return response_or_exc
