#23426: migrations.RunSQL's function signature implies it won't do any parameter
substitution
-------------------------------------+-------------------------------------
     Reporter:  ris                  |                    Owner:
         Type:                       |  Markush2010
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  1.7
     Severity:  Normal               |               Resolution:
     Keywords:  migrations sql       |             Triage Stage:  Accepted
  runsql params escape               |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  1                    |
-------------------------------------+-------------------------------------

Comment (by claudep):

 I think we should be consistent with how the related issue with
 `cursor.execute` has been fixed in Django 1.6. See how it's documented
 now: https://docs.djangoproject.com/en/1.7/topics/db/sql/#executing-
 custom-sql-directly
 If we don't provide parameters, it should be possible to include single
 `%` chars without Django trying any extrapolation (e.g. passing None to
 execute, like the first example in the previous comment). We can then
 allow passing parameters to `RunSQL` and document it like we did for
 `cursor.execute` (`%` has to be doubled when and only when params are
 provided).
 While the first fix should be backported to 1.7.1, the second could be
 delayed in 1.8 as a new functionality. Thoughts about that plan?

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.ecd4357409dea375edba3c8bfa2bada1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to