Re: [Django] #34168: Add support for list of parameters to the QuerySet.raw(). (was: add proper quoting for lists in raw SQL queries)

5 views
Skip to first unread message

Django

unread,
Nov 17, 2022, 9:05:00 AM11/17/22
to django-...@googlegroups.com
#34168: Add support for list of parameters to the QuerySet.raw().
-------------------------------------+-------------------------------------
Reporter: Marek Rouchal | Owner: nobody
Type: New feature | Status: closed
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => wontfix


Comment:

Thanks for this ticket. It already works on PostgreSQL and MySQL (however
unintentionally) when passing list of tuples, e.g.
{{{#!python
query = "SELECT * FROM raw_query_author WHERE first_name in %s"
params = [("Bill", "Jill")]
Author.objects.raw(query, params=params)
}}}
We don't really want to encourage users to use `raw()` anymore since
almost everything is covered by the ORM, so adding a new feature to raw
queries is always a bit controversial.
Please first start a discussion on the DevelopersMailingList, where you'll
reach a wider audience, and
[https://docs.djangoproject.com/en/stable/internals/contributing/bugs-and-
features/#requesting-features follow the guidelines with regards to
requesting features]. Initially "wontfix" from me.

--
Ticket URL: <https://code.djangoproject.com/ticket/34168#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages