I installed views and wanted to describe one of my own tables, called Recipes, to it. I did this be creating a modules called Recipes and in this module I created a file recipe.views.inc as described in the documentation.
recipe.views.inc
<?php
function recipe_views_data() {
$data = array();
$data['Recipes']['table']['group'] = t('Recipes');
$data['Recipes']['table']['base'] = array(
'field' => 'id',
'title' => t('Recipes'),
'help' => t("Contains recipes data."),
'weight' => -10,
);
$data['Recipes']['table']['join'] = array(
'users' => array(
'left_field' => 'uid',
'field' => 'user_id',
),
);
$data['Recipes']['id'] = array(
'title' => t('Recipe id'),
'help' => t('The unique id for the recipe.'),
);
$data['Recipes']['name'] = array(
'title' => t('Name'),
'help' => t('User entered recipe name.'),
'field' => array(
'handler' => 'views_handler_field',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
'argument' => array(
'handler' => 'views_handler_argument_string',
),
);
$data['Recipes']['datecreated'] = array(
'title' => t('Date Created'),