[Django] #35629: Implement async cursors

46 views
Skip to first unread message

Django

unread,
Jul 24, 2024, 4:02:40 PM7/24/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Type: New
| feature
Status: new | Component: Database
| layer (models, ORM)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
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.''
--
Ticket URL: <https://code.djangoproject.com/ticket/35629>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 25, 2024, 7:44:46 AM7/25/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* cc: Dingning, Jon Janzen, Andrew Godwin (added)
* stage: Unreviewed => Accepted

Comment:

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
--
Ticket URL: <https://code.djangoproject.com/ticket/35629#comment:1>

Django

unread,
Jul 25, 2024, 7:51:16 AM7/25/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Owner: Flavio
| Curella
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* owner: (none) => Flavio Curella
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35629#comment:2>

Django

unread,
Jul 26, 2024, 11:22:30 AM7/26/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Owner: Flavio
| Curella
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Flavio Curella):

Pull Request is at https://github.com/django/django/pull/18408
--
Ticket URL: <https://code.djangoproject.com/ticket/35629#comment:3>

Django

unread,
Aug 5, 2024, 4:00:14 PM8/5/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Owner: Flavio
| Curella
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async, psycopg, | Triage Stage: Accepted
PostgreSQL |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Paolo Melchiorre):

* cc: Paolo Melchiorre (added)
* keywords: => async, psycopg, PostgreSQL

--
Ticket URL: <https://code.djangoproject.com/ticket/35629#comment:4>

Django

unread,
Aug 7, 2024, 3:02:45 PM8/7/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Owner: Flavio
| Curella
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async, psycopg, | Triage Stage: Accepted
PostgreSQL |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Evstifeev Roman):

* cc: Evstifeev Roman (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/35629#comment:5>

Django

unread,
Nov 8, 2024, 3:44:54 AM11/8/24
to django-...@googlegroups.com
#35629: Implement async cursors
-------------------------------------+-------------------------------------
Reporter: Flavio Curella | Owner: Flavio
| Curella
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: async, psycopg, | Triage Stage: Accepted
PostgreSQL |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35629#comment:6>
Reply all
Reply to author
Forward
0 new messages