flask-sqlalchemy icon indicating copy to clipboard operation
flask-sqlalchemy copied to clipboard

Have the SQLALCHEMY_RECORD_QUERIES setting take precedence over DEBUG

Open csdev opened this issue 9 years ago • 5 comments

This allows query recording to be disabled regardless of the other application settings

csdev avatar Jun 16 '15 18:06 csdev

You know that documentation says that queries are always recorded in debug mode? maybe the pull request should also change the documentation ( if it gets accepted )

bastianh avatar Jun 17 '15 20:06 bastianh

Right on @bastianh, I'm always cautious to change existing and documented behaviour like this.

Have you come a cropper with the current precedence @csdev?

immunda avatar Jun 18 '15 11:06 immunda

@immunda that is definitely a valid concern. This is a change in application behavior that should probably wait for a major release. The reason I am proposing it is because it would be nice to disable query recording even though debug mode is on. In one of my projects, we have some database tasks that run a large set of queries. We have found that query recording can use up an excessive amount of memory.

@bastianh I will take a look at the docs later and add those changes to the pull request.

csdev avatar Jun 19 '15 04:06 csdev

Dupe of #186 (although I prefer this version as it also updates the docs)

jeffwidman avatar May 05 '16 07:05 jeffwidman

Thank you for your contribution and sorry this reply is so long in coming. Setting the milestone for this PR to 3.0 since it changes observable behavior.

rsyring avatar Mar 08 '19 21:03 rsyring

This is fixed in #1087. However, I'm considering removing the automatic behavior and always requiring the config to be set.

davidism avatar Sep 18 '22 16:09 davidism