I've tried to use db_set_active to switch to another DB on my multi-site installation, then use the nice_menus module to fetch menus from the other DB. Unfortunately, the menus are already cached Drupal's core (the menu_get_menu function of menu.inc) so I have only got the menus from the regular DB.

From my research, set_active_db is not a very highly used function. The function is currently ignored by the menu and cache system - it's only useful for direct queries.

I've succeeded using db_set_active to fetch data from other Drupal DBs on the same multi-site, but it requires serious extension for full core support.

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | Effective Hosting Strategies | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

Comments

druvision’s picture

Title: db_set_active is ignored by menu_get_menu and other caching functions. » Make db_set_active work with menu_get_menu and drupal functions
greg.harvey’s picture

Title: Make db_set_active work with menu_get_menu and drupal functions » Allow Drupal to place different tables (shared or otherwise) in different databases
Version: 5.3 » 7.x-dev
Category: bug » feature

+1

But it isn't really a bug - it's pretty much what I'm talking about here, I think: http://drupal.org/node/292367

Crell’s picture

Status: Active » Closed (duplicate)