SQLALchemy supports dealing with explicit Connection objects as an alternative to BoundMetaData or DynamicMetaData. that way you could access each database in a more explicit way, if desired:
connection1.execute(tablea.select()) connection2.execute(tablea.select()) this is also supported by the Session using the bind_to keyword argument and bind() methods. with the DynamicMetaData, yeah youd have to switch it around for each database when you want to switch. Valentin Kuznetsov wrote: > Hi, > I have several DBs whose schema identical. I found that I can use > meta = DynamicMetaData() > meta.connect(engine1) > meta.connect(engine2) > > I know how to upload all tables and keep them in local cache. What I > don't understand is > how to access given table from different DBs. For instance, both DBs > has table A. > If I'd like to use table_A from engine1, do I need to connect first > to that engine? > And right after that if I want to use table_A from engine2, do I need > to connect > to engine2? > How to drop connections? Can I cache connections? > > Thanks, > Valentin. > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users