#29940 closed Cleanup/optimization (fixed)
Update "Performing raw SQL queries" doc to recommend not using raw()
Reported by: | Katie McLaughlin | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 2.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
The documentation on this page is 5-10 years old and doesn't reflect the current state of the ORM, where there shouldn't be a reason to drop to raw() SQL any more, given annotations, aggregation, explain plans and custom query expressions.
It should be updated to have above the fold: "Don't do this". But until raw()
is completely removed, the page should detail how to do it.
I'll submit a PR to do just this, but I would appreciate a second opinion on how best to word/present this.
https://docs.djangoproject.com/en/2.1/topics/db/sql/
Reference talk: https://youtu.be/p9Bgr5VOISo?t=1433
Change History (3)
comment:1 by , 6 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Summary: | Update "Performing raw SQL queries" doc in 2.1 to recommend not using raw() → Update "Performing raw SQL queries" doc to recommend not using raw() |
Triage Stage: | Unreviewed → Accepted |
PR
I agree with what Simon said on the ticket. There are still use cases for
raw()
and it's not likely to be deprecated.