I think the answer to this partly depends on which parts of SA you are
using, and how your databases are set up. If all the databases have
different schemas, and you are using the low-level SA API (or your ORM
objects are each defined against a single database), I would probably
use a metadata/engine instance per database. You can then define your
Table objects against the appropriate metadata instances.

If you need to persist the same ORM class to multiple databases, then
you could look in to the 'bind_to' parameter to create_session
(mentioned here:
http://www.sqlalchemy.org/docs/unitofwork.html#unitofwork_api_bind).

Hope that helps,

Simon

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Alchemist
Sent: 30 May 2007 14:19
To: sqlalchemy
Subject: [sqlalchemy] how to retrieve/update data from/on multiple
databases


Working with:
Python 2.4
SQLAlchemy 0.3.7
Postgresql 8.2 database servers

I am working in a multidatabase environment.  I need to perform a
query over multiple databases, then manipulate the obtained results
and commit my changes in different tables in different databases.

How can I query from multiple databases?
How can INSERTs/UPDATEs be performed on different tables in different
databases?

Thank you.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to