Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 1 (modified by jvanasco@…, 13 years ago) (diff)


Q. Can I use more than one database handle with TurboGears ?

  1. You sure can! At least with SQLalchemy

Configure your .cfg file

handle_b.sqlalchemy.dburi="postgres://database= dba&host=localhost&user= userb&password=xyz"

Configure your

engine_a = __engine_a__ = PackageEngine("handle_a")
engine_b = __engine_b__ = PackageEngine("handle_b")

Then just instantiate tables / classes using engine_a or engine_b

What about having the same class read using one handle ( readonly slave db ) and write using another ( writing master )?

someone else will have to answer that one. let me know when you figure it out!