Optional check that ensure statement timeout is set on supported databases
skarzi opened this issue · comments
Łukasz Skarżyński commented
See wemake-services/wemake-django-template#1064 for more details.
Łukasz Skarżyński commented
I've investigated this issue more deeply, so generally only 2 backends support setting to stop queries that execution take too long:
postgresql
viastatement_timeout
mysql
viamax_execution_time
When working on this feature we can think about adding some more checks for other database settings, because to implement this check we can reuse common components:
- new database backend's related class (something similar to
django.db.backends.base.features
) for getting settings names and values for particular thing (e.g timing out statements) - some common validators of this settings (e.g.
statement_timeout
cannot be turned off or set to too big value)
so adding new checks should be relatively simple.
Nikita Sobolev commented
Thanks a lot for your thoughtful research!
I guess we can start with postgres
/ mysql
and someday eventually come to more complex engines.