On Thu, Aug 26, 2010 at 12:09 AM, Michael Manfre <mman...@gmail.com> wrote: > > On Aug 24, 9:30 pm, Russell Keith-Magee <russ...@keith-magee.com> > wrote: >> I don't follow your logic here. > > I guess I'm more of the mindset of query hints having as much to do > with the stored data as the schema and most hints would probably be a > premature optimization or specific to a failing with a specific > database version. I do acknowledge that there are situations where > being able to ship hint corrections for known issues would be useful, > but I can't escape from the thought that those situations would attach > an expectation about which database backend should, or should probably > not be used with the app.
A reasonable objection. The problem is that a query is contained in code; if I (as an end-user) discover that a particular query needs to be hinted, I don't have an entry point. Putting a with_hint() keyword into the query provides that entry point, but then means that we need to be able to account for the case where the same app is deployed under MySQL and Postgres. A namespace is the best way I can think to acheive this. Of course, I'm open to any other suggestion for how we can separate the location where the hint is required from the actual hint definition. >> And that's the proposal on the table, except that you would need to >> specify that this is a MSSQL hint, since the hint you're making isn't >> of any use to a user of any database other than MSSQL. > > I'm assuming the current proposal will allow for arbitrary namespaces > that are defined simply by a backend willing to look for the specific > name. If not, there would need to be discussion about which namespaces > are defined by the core and how unsupported backends would register > new namespaces. Correct. The current proposal makes the namespace the last part of the backend's import path (e.g., mysql for the django.db.backends.mysql backend). This does have the potential for collisions if you write a custom mysql backend in a different location. However, there isn't a huge population of backends, so the practical likelihood of collision is relatively small. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.