#15670: Doc issue: Some checking *is* performed on the SQL statement passed to raw() ---------------------------+--------------------------- Reporter: dbreslau | Owner: nobody Status: new | Milestone: Component: Documentation | Version: 1.2 Keywords: | Triage Stage: Unreviewed Has patch: 0 | ---------------------------+--------------------------- The doc page for Performing Raw Queries says:
'''Warning''' No checking is done on the SQL statement that is passed in to .raw(). Django expects that the statement will return a set of rows from the database, but does nothing to enforce that. If the query does not return rows, a (possibly cryptic) error will result. This isn't entirely true. In db/models/sql/query.py, the `RawQuery` class contains a method, `validate_sql`, that throws an exception if the statement doesn't begin with "SELECT". We'd actually rather it didn't do this check, as we'd like to be able to run an UPDATE...RETURNING (as supported by Oracle and PostgreSQL) via the raw query mechanism. But if it's going to do this, then the documentation should reflect the checking. -- Ticket URL: <http://code.djangoproject.com/ticket/15670> Django <http://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 post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.
