diff --git a/flask_sqlalchemy/__init__.py b/flask_sqlalchemy/__init__.py index 7f5423b9..7cfc032a 100644 --- a/flask_sqlalchemy/__init__.py +++ b/flask_sqlalchemy/__init__.py @@ -805,7 +805,13 @@ def init_app(self, app): of an application not initialized that way or connections will leak. """ - app.config.setdefault('SQLALCHEMY_DATABASE_URI', 'sqlite://') + 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)