On Thu, Mar 12, 2009 at 11:53 PM, Alex Gaynor <alex.gay...@gmail.com> wrote:
> Great, since we've moved so quickly on improving our plumbing for this there
> was one other idea I wanted to put forth(since I believe it needs to happen
> for any multidb implementation).  In terms of plumbing the cornerstone of my
> multidb proposal is the addition of a django.db.connections object which
> lazily returns connections by subscripting based on a DATABASES option which
> is a dictionary of dictionaries.  I think we could add support for this
> relatively easily, with full backwards compatibility.  However, we only have
> 1 week until feature freeze so I wouldn't want to proceed with this unless
> everyone was completely comfortable with that proposed API, but I figured
> I'd bring it up since we have moved so quickly on these past bits.

Yeah, a collection of connections (called django.db.connections or
whatever) is one of the next logical steps for multi-database support.
But for the time being, that's 90% just a pretty API and only 10%
plumbing. It can be worked-around completely without changing Django
internals. (I've got a DATABASES setting in my application, along with
a custom manager that checks the setting to get connection-specific
parameters -- code very similar to
http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/
)

Regarding the one-week-until-feature-freeze reality -- we haven't
*hit* the feature freeze yet, so it seems like it's still fair game,
but this *would* be a bigger change than the previous few, so it'd be
worth discussing the pluses and minuses.

A bigger issue (one that requires plumbing, unless I'm completely
missing something) is to get django/db/transaction.py to be aware of
the multiple connections. All of the functions in there deal directly
with the global connection, and I don't immediately see an easy way to
refactor things to work on separate connections. Any ideas? Alex, have
you addressed this in the Grand Proposal of yours? :-)

Adrian

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to