|
| chado_add_mview ($name, $modulename, $mv_schema, $query, $comment=NULL, $redirect=TRUE) |
|
| chado_edit_mview ($mview_id, $name, $modulename, $mv_table, $mv_specs, $indexed, $query, $special_index, $comment=NULL, $mv_schema=NULL) |
|
| chado_get_mview_id ($view_name) |
|
| chado_get_mview_table_names () |
|
| chado_refresh_mview ($mview_id) |
|
| chado_get_mviews () |
|
| chado_delete_mview ($mview_id) |
|
| chado_populate_mview ($mview_id) |
|
Provides an application programming interface (API) to manage materialized views in Chado The Perl-based chado comes with an interface for managing materialzed views. This API provides an alternative Drupal-based method.
◆ chado_add_mview()
chado_add_mview |
( |
|
$name, |
|
|
|
$modulename, |
|
|
|
$mv_schema, |
|
|
|
$query, |
|
|
|
$comment = NULL , |
|
|
|
$redirect = TRUE |
|
) |
| |
Add a materialized view to the chado database.
- Parameters
-
$name | The name of the materialized view. |
$modulename | The name of the module submitting the materialized view (e.g. 'tripal_library'). |
$mv_schema | If using the newer Schema API array to define the materialized view then this variable should contain the array or a string representation of the array. |
$query | The SQL query that loads the materialized view with data. |
$comment | A string containing a description of the materialized view. |
$redirect | Optional (default: TRUE). By default this function redirects back to admin pages. However, when called by Drush we don't want to redirect. This parameter allows this to be used as a true API function. |
- Returns
- TRUE if the materialized view was successfully added, FALSE otherwise.
◆ chado_delete_mview()
chado_delete_mview |
( |
|
$mview_id | ) |
|
Does the specified action for the specified Materialized View.
- Parameters
-
$op | The action to be taken. One of update or delete. |
$mview_id | The unique ID of the materialized view for the action to be performed on. |
- Returns
- TRUE if the deletion was a success, FALSE on error.
◆ chado_edit_mview()
chado_edit_mview |
( |
|
$mview_id, |
|
|
|
$name, |
|
|
|
$modulename, |
|
|
|
$mv_table, |
|
|
|
$mv_specs, |
|
|
|
$indexed, |
|
|
|
$query, |
|
|
|
$special_index, |
|
|
|
$comment = NULL , |
|
|
|
$mv_schema = NULL |
|
) |
| |
Edits a materialized view to the chado database to help speed data access. This function supports the older style where postgres column specifications are provided using the $mv_table, $mv_specs and $indexed variables. It also supports the newer preferred method where the materialized view is described using the Drupal Schema API array.
- Parameters
-
$mview_id | The mview_id of the materialized view to edit. |
$name | The name of the materialized view. |
$modulename | The name of the module submitting the materialized view (e.g. 'tripal_library'). |
$mv_table | The name of the table to add to chado. This is the table that can be queried. |
$mv_specs | The table definition. |
$indexed | The columns that are to be indexed. |
$query | The SQL query that loads the materialized view with data. |
$special_index | currently not used. |
$comment | A string containing a description of the materialized view. |
$mv_schema | If using the newer Schema API array to define the materialized view then this variable should contain the array. |
◆ chado_get_mview_id()
chado_get_mview_id |
( |
|
$view_name | ) |
|
Retrieve the materialized view_id given the name.
- Parameters
-
$view_name | The name of the materialized view. |
- Returns
- The unique identifier for the given view.
◆ chado_get_mview_table_names()
chado_get_mview_table_names |
( |
| ) |
|
Retrieves the list of materialized views in this site.
- Returns
- An associative array where the key and value pairs are the table names.
◆ chado_get_mviews()
Retrieves the list of materialized view IDs and their names.
- Returns
- An array of objects with the following properties: mview_id, name.
◆ chado_populate_mview()
chado_populate_mview |
( |
|
$mview_id | ) |
|
Populate a Materialized View.
- Parameters
-
$mview_id | The unique identifier for the materialized view to be updated. |
- Returns
- True if successful, FALSE otherwise.
◆ chado_refresh_mview()
chado_refresh_mview |
( |
|
$mview_id | ) |
|
Populates the specified Materialized View.
- Parameters
-
$mview_id | The unique ID of the materialized view for the action to be performed on. |