﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32092	Add an async db backend: asyncpg	Andrew Chen Wang	nobody	"This ticket wishes to add an asynchronous DB backend, namely using [https://github.com/MagicStack/asyncpg asyncpg].

I've recently finished porting [https://code.djangoproject.com/ticket/32076 Django's cache to use async methods] in an async context. I'm continuing along my opinion that we need to have the layer of the cake down, i.e. the cache and the db backends, before the rest of the async porting of Django can continue. Thus, I'd like to begin getting an async database backend as well using asyncpg for a future async Django ORM along with async template loading (since psycopg3 is not complete).

I don't have much experience with the ORM itself, but I'd like to get the work started. One of the reasons this hasn't been started grandly is mentioned in DEP 9:

> A lot of this stems from the fact that the underlying database drivers are synchronous

[https://github.com/django/deps/blob/master/accepted/0009-async.rst#the-orm from here] and because Andrew, not me, is pretty busy lately. I think I can alleviate some of the workload by implementing this backend as a way to get started testing an async ORM."	New feature	new	Database layer (models, ORM)	dev	Normal		database		Unreviewed	0	0	0	0	0	0
