Views: Define table without describing it as a base OR join table? The Views API in advanced help says "For Views to use your table, it has to either be a base table, or know how to link to an existing base table. Or sometimes both. "

I'm trying to add an "address" table to joins to the "person" table. The "person" table is a base table, "address" is not.

I can do this:

  $data['address'] = array(
    'table' =&gt; array(
      'group' =&gt; t('Address'),
      'join' =&gt; array(
        'person' =&gt; array(
          'left_field' =&gt; 'id',
          'field' =&gt; 'personID',
        ),
      ),
    ),
  );


However, this creates an implicit join relationship in views, meaning it will automatically make all fields in the "address" table available to the view and join the data with LEFT JOIN.

What I want to do is instead just add a relationship handler to the "personID" field so that the relationship is explicit, meaning a user must manually add the relationship.

I have successfully added this relationship handler to the "personID" field, and I can add the relationship. When adding the fields from this table, I can chose to use the relationship to add the field instead of the implicit relationship.

I want to completely remove the implicit relationship, and only allow users to add the data from the relationship handler. When I remove the 'join' data above, views won't allow me to add the relationship manually.

Is this possible? Or does that require that I define my joined table as a base table as well?
You should be able to add a relationship by using hook_views_data. You should however not use the join, but the relationship (right below the huge php comment on the linked page):

// Node ID table field.
$data['example_table']['nid'] = array(
  'title' =&gt; t('Example content'),
  'help' =&gt; t('Some example content that references a node.'),

  // Define a relationship to the {node} table, so example_table views can
  // add a relationship to nodes. If you want to define a relationship the
  // other direction, use hook_views_data_alter(), or use the 'implicit' join
  // method described above.
  'relationship' =&gt; array(
    'base' =&gt; 'node', // The name of the table to join with.
    'base field' =&gt; 'nid', // The name of the field on the joined table.
    // 'field' =&gt; 'nid' -- see hook_views_data_alter(); not needed here.
    'handler' =&gt; 'views_handler_relationship',
    'label' =&gt; t('Default label for the relationship'),
    'title' =&gt; t('Title shown when adding the relationship'),
    'help' =&gt; t('More information on this relationship'),
  ),
);