#1142: Support for multiple database connections
---------------------------------------------------+------------------------
Reporter: Simon Willison | Owner:
darylspitzer
Status: assigned | Milestone: post-1.0
Component: Database layer (models, ORM) | Version:
Resolution: | Keywords: multiple
database feature
Stage: Someday/Maybe | Has_patch: 1
Needs_docs: 1 | Needs_tests: 0
Needs_better_patch: 1 |
---------------------------------------------------+------------------------
Changes (by Tarken):
* cc: [EMAIL PROTECTED] (added)
Comment:
What is the current status on this issue? There doesn't appear to have
been any visible movement in several months now, and this is something
which would be very useful in a project I'm working on. I have a slightly
different use case than the previously mentioned ones, however... and I'm
sure it's not an entirely common one, but perhaps something to take into
consideration.
The company I work for is sitting on a fairly large data warehouse for a
number of clients. Each client has their own database, with a common
schema, on one of two MS SQL 2k servers. In the near future, we will
hopefully be moving some of these clients onto a PostgreSQL server (and in
the distant future, it would be nice to move towards Greenplum; although
that should be transparent with psycopg2, afaik). In addition, there is a
separate database already running on the PostgreSQL server, which stores
configuration parameters and which I am using for the Django system
tables.
On every page load, I need Django to connect to database 'A' on the
PostgreSQL server for any Django specific operations, then connect to an
arbitrary database on either of the MS SQL servers, depending on which of
our clients' data is currently being viewed. From what I've seen so far in
the discussion in this ticket and on MultipleDatabaseSupport, this doesn't
sound like it would likely be a supported scenario, as the connection to
be used is determined dynamically, rather than a static connection chosen
per model. In my case, all models apply across all database connections.
Now, I have made this work thus far with my own connection manager
(http://dpaste.com/hold/84458/) but using it is somewhat kludgy and I'm
sure it's far from a full implementation. I also had to apply a hack
(http://code.google.com/p/django-pyodbc/issues/detail?id=18) to django-
pyodbc and apply a pending patch (#6710) to Django in order to get it to
work. Here is an example of why it in use: http://dpaste.com/hold/84465/
--
Ticket URL: <http://code.djangoproject.com/ticket/1142#comment:57>
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
-~----------~----~----~----~------~----~------~--~---