On Tue, Nov 17, 2009 at 3:19 AM, Warren Smith <war...@wandrsmith.net> wrote: > On Fri, Nov 13, 2009 at 8:06 PM, Russell Keith-Magee > <freakboy3...@gmail.com> wrote: >>> Would it make sense to factor out the connection selection logic into >>> a utility function with parameters that make it usable in all >>> contexts, thus yielding a single place to inject the check for the >>> request-specific default db alias (and perhaps other logic to support >>> master/slave, etc.)? >> >> That's the eventual intent - a callback or plugin that will be >> registered, probably with a model manager, that will provide an answer >> to the "which database should I be using for this query" question. >> Different implementations of this API will then exist for >> master/slave, sharding, etc. The exact form of this API is yet to be >> determined. >> > > Is developing this API in scope for 1.2?
It's certainly in scope. Multi-db is in scope, and APIs to use multi-db cleanly will be required. However, realistically, this particular feature still needs some design work, and the 1.2 feature deadline is just over a month away. I suspect what will end up landing for v1.2 is the simple interface that allows users to manually direct query X at database Y; 1.3 will then include the pretty interface that makes it easy to control the use of the simple interface. That said, it's still possible that this could be done for v1.2. If you want to help out, Alex's multi-db branch on github [1] contains the working base of code, and it is getting close to being complete for the simple case. Any feedback or development assistance is most welcome. [1] http://github.com/alex/django/tree/multiple-db > My impression is that my use case is not very common. Therefore, it > may not make sense for it to be officially supported by django. It may not be supported out of the box, but that doesn't mean we don't want it to be possible. Suggestions welcome. > I'm going to run with some of these ideas in my custom version of > django and see what I come up with. Excellent. If you discover anything interesting, let us know. 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=.