[Django] #36391: Document RawSQL on “Performing raw SQL queries” page

15 views
Skip to first unread message

Django

unread,
May 14, 2025, 7:59:11 AMMay 14
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Type:
| Cleanup/optimization
Status: new | Component: Database
| layer (models, ORM)
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
#25212 documented
[https://docs.djangoproject.com/en/stable/ref/models/expressions/#django.db.models.expressions.RawSQL
the `RawSQL` expression class]. However, it didn’t add a mention to
[https://docs.djangoproject.com/en/stable/topics/db/sql/
`topics/db/sql.txt`], “Performing raw SQL queries”, which lists the “two
ways” Django gives users to perform raw SQL queries.

`RawSQL` represents a third way, although it is only usable for subqueries
of a non-raw `QuerySet` query, so I believe it deserves a mention on that
page too.
--
Ticket URL: <https://code.djangoproject.com/ticket/36391>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 14, 2025, 7:59:19 AMMay 14
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* easy: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36391#comment:1>

Django

unread,
May 14, 2025, 9:01:04 AMMay 14
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Unreviewed => Accepted

Comment:

Hello Adam, thank you for your ticket! This makes sense, accepting.
--
Ticket URL: <https://code.djangoproject.com/ticket/36391#comment:2>

Django

unread,
May 16, 2025, 5:00:01 AMMay 16
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: shin wo
Type: | jin
Cleanup/optimization | 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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by shin wo jin):

* has_patch: 0 => 1
* owner: (none) => shin wo jin
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/36391#comment:3>

Django

unread,
May 16, 2025, 7:40:50 AMMay 16
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: shin wo
Type: | jin
Cleanup/optimization | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* has_patch: 1 => 0

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

Django

unread,
May 16, 2025, 3:38:13 PMMay 16
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: shin wo
Type: | jin
Cleanup/optimization | 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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by shin wo jin):

* has_patch: 0 => 1

Comment:

The documentation for using RawSQL in ORM expressions has been added in
PR(https://github.com/django/django/pull/19475)
This should resolve the issue described in this ticket.

Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/36391#comment:5>

Django

unread,
May 26, 2025, 9:54:30 AMMay 26
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: shin wo
Type: | jin
Cleanup/optimization | 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: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36391#comment:6>

Django

unread,
Dec 25, 2025, 4:10:38 PM (11 hours ago) Dec 25
to django-...@googlegroups.com
#36391: Document RawSQL on “Performing raw SQL queries” page
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Amar
Type: | Status: assigned
Cleanup/optimization |
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: 1
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Amar):

* owner: shin wo jin => Amar

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