Repository: rednaks/django-async-orm (language: python)

Issue:
Perhaps it is better to use channels?
Perhaps it's worth starting [django-channels](https://github.com/django/channels) library for asynchronous db calls?

There is a function there. And, as I understand it, it will be more effective than it is now.
![image](https://user-images.githubusercontent.com/81916132/170006981-b8bd180f-f2a0-4e80-9f9d-0afaa64711e2.png)



Discussion / hints:

Fix patch:
diff --git a/django_async_orm/query.py b/django_async_orm/query.py
index 6b3b98a..f2aeed7 100644
--- a/django_async_orm/query.py
+++ b/django_async_orm/query.py
@@ -1,6 +1,6 @@
 import concurrent
 
-from asgiref.sync import sync_to_async
+from channels.db import database_sync_to_async as sync_to_async
 from django.db.models import QuerySet
 
 from django_async_orm.iter import AsyncIter
diff --git a/django_async_orm/wrappers.py b/django_async_orm/wrappers.py
index 27dc362..af0eca9 100644
--- a/django_async_orm/wrappers.py
+++ b/django_async_orm/wrappers.py
@@ -1,4 +1,4 @@
-from asgiref.sync import sync_to_async
+from channels.db import database_sync_to_async as sync_to_async
 from django.contrib.auth import login, logout
 
 


Test patch:
diff --git a/tests/requirements.txt b/tests/requirements.txt
index 27c16bb..7bbcac1 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -5,7 +5,7 @@ black==22.12.0; python_version >= "3.7"
 certifi==2022.12.7; python_version >= "3.7" and python_version < "4" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0")
 charset-normalizer==3.0.1; python_version >= "3.7" and python_version < "4" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0")
 click==8.1.3; python_version >= "3.7"
-codecov==2.1.12; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
+codecov==2.1.13; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
 colorama==0.4.6; python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" and platform_system == "Windows" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.7.0" and platform_system == "Windows"
 coverage==7.1.0; python_version >= "3.7"
 distlib==0.3.6; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
@@ -39,3 +39,4 @@ urllib3==1.26.14; python_version >= "3.7" and python_full_version < "3.0.0" and
 virtualenv==20.16.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
 wcwidth==0.2.6; python_version >= "3.5"
 zipp==3.11.0; python_version < "3.8" and python_version >= "3.7" and python_full_version >= "3.6.1" and (python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "3.8" or python_full_version >= "3.5.0" and python_version < "3.8" and python_version >= "3.6")
+channels