wemake-services / django-test-migrations

Test django schema and data migrations, including migrations' order and best practices.

Home Page:https://pypi.org/project/django-test-migrations/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optional check that ensure statement timeout is set on supported databases

skarzi opened this issue · comments

I've investigated this issue more deeply, so generally only 2 backends support setting to stop queries that execution take too long:

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.

Thanks a lot for your thoughtful research!

I guess we can start with postgres / mysql and someday eventually come to more complex engines.