Opened 7 months ago
Last modified 3 months ago
#35629 assigned New feature
Implement async cursors
Description ¶
With Psycopg3 offering async connections and async cursors, we can start implementing at least part of DEP0009 on the ORM
The first step would be just a low-level API, so that we can make the async cursor available to our users:
from django.db import new_connection async with new_connection(using="default") as conn: async with conn.acursor() as c: await c.execute(...)
Note: In order to have a simpler and easier review, I've considered transaction.atomic
out of scope for this ticket.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To improve the patch as described in the pull request review comments or on this ticket, then uncheck "Patch needs improvement".
If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (6)
comment:1 by , 7 months ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 7 months ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:4 by , 6 months ago
Cc: | added |
---|---|
Keywords: | async psycopg PostgreSQL added |
comment:5 by , 6 months ago
Cc: | added |
---|
comment:6 by , 3 months ago
Patch needs improvement: | set |
---|
I see this was suggested as part 1 of a plan here: https://forum.djangoproject.com/t/dep0009-orm-implementation-plan/33194 with some positive feedback from Andrew Godwin
Tentatively accepted