Currently one can only map Drupal tables to views. It would be great if one could also map tables in other databases (on the same server) to views.

For example, if one installs a non-Drupal package like Wikimedia or FUDforum, one can easily integrate them into the Drupal framework using views.

Comments

merlinofchaos’s picture

Off the top of my head, I'd say this would only be possible if you can get them into the same database space. Since Drupal uses db prefixes, this might actually be possible.

At which point, Views doesn't need any modification at all, you have to tell views about the data and how to join it to the node table.

If it's in another database space...that's a little beyond my abilities. I don't know how to do joins across databases.

Now, I have a plan sitting on the back burner to detach views somewhat from the node table, so it may become possible to have views manage stuff that isn't nodes, but the plan still has a few bugs.

merlinofchaos’s picture

Status: Active » Postponed

I'm marking this postponed in an attempt to reduce the number of active issues, but to not actually close the issue. There's some merit to this. It requires discussion.

joemoraca’s picture

Title: Map tables in non-drupal databases to views » Map non- node tables to views
Version: 4.7.x-1.x-dev » 5.x-1.5

I would love this feature. Just one use case ... I created a custom form to enter URLs for website (with taxonomy mapping). I want a "view" to view them all on one page -- using exposed filters would be awesome

I am doing this with PHP in a page node for now.

moshe weitzman’s picture

you can easily join tables across databases using drupal's prefixing feature. just put your database name in the prefix. anyway, the resulting query is something like

SELECT * FROM drupal.user du INNER JOIN fudforum.user fu ON du.name=fu.name

nancydru’s picture

...plan sitting on the back burner to detach views somewhat from the node table... I'd certainly vote for at least detaching the users table from the node table. I really don't want to see 657 pictures of myself when I want to list users in a particular role.

sun’s picture

Version: 5.x-1.5 » 6.x-2.x-dev
Status: Postponed » Fixed

This issue has been resolved in Views 2.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

giorgio79’s picture

Hi Sun,

Could you point to some documentation explaining how I can do this in Views 2, or 3?

giorgio79’s picture

Found it, inside advanced help
yoursite.com/help/views/api-tables

PS For anyone looking for an automated way, check out http://www.drupal.org/project/data