Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ A list of configuration keys currently understood by the extension:
be useful for debugging.
``SQLALCHEMY_RECORD_QUERIES`` Can be used to explicitly disable or
enable query recording. Query recording
automatically happens in debug or testing
mode. See :func:`get_debug_queries` for
more information.
is turned on by default in debug or
testing mode, but that behavior can be
overridden using this option. See
:func:`get_debug_queries` for more
information.
``SQLALCHEMY_NATIVE_UNICODE`` Can be used to explicitly disable native
unicode support. This is required for
some database adapters (like PostgreSQL
Expand Down
4 changes: 2 additions & 2 deletions flask_sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,11 @@ def __get__(self, obj, type):


def _record_queries(app):
if app.debug:
return True
rq = app.config['SQLALCHEMY_RECORD_QUERIES']
if rq is not None:
return rq
if app.debug:
return True
return bool(app.config.get('TESTING'))


Expand Down