Tripal
Functions
Chado Materalized Views

Functions

 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, ChadoConnection $chado=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)
 

Detailed Description

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.

Function Documentation

◆ chado_add_mview()

chado_add_mview (   $name,
  $modulename,
  $mv_schema,
  $query,
  $comment = NULL,
  $redirect = TRUE 
)

Add a materialized view to the chado database.

Deprecated:

Please use the "tripal_chado.materialized_view" service instead.

For Tripal v4 the redirect argument no longer works. Also, the function no longer sets a Drupal message. The callee should do this.

Parameters
$nameThe name of the materialized view.
$modulenameThe name of the module submitting the materialized view (e.g. 'tripal_library').
$mv_schemaThe Drupal table definition array.
$queryThe SQL query that loads the materialized view with data.
$commentA string containing a description of the materialized view.
$redirectNon functional.
Returns
TRUE if the materialized view was successfully added, FALSE otherwise.

◆ chado_delete_mview()

chado_delete_mview (   $mview_id)

Deletes a Materialized View.

Deprecated:

Please use the "tripal_chado.materialized_view" service instead.

Parameters
$mview_idThe 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,
ChadoConnection  $chado = NULL 
)

Edits a materialized view.

Deprecated:

Please use the "tripal_chado.materialized_view" service instead.

Parameters
$mview_idThe mview_id of the materialized view to edit.
$nameThe name of the materialized view.
$modulenameNo longer used.
$mv_tableThe name of the table to add to chado. This is the table that can be queried.
$mv_specsThe table definition.
$indexedNo longer used.
$queryThe SQL query that loads the materialized view with data.
$special_indexNo longer used.
$commentA string containing a description of the materialized view.
$mv_schemaIf 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.

Deprecated:

Please use the findByName() function of the Materialized Views Manager Service instead. For example:

$mviews = \Drupal::service('tripal_chado.materialized_views');
$mview_id = $mviews->findByName($table_name);
Parameters
$view_nameThe 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.

Deprecated:

Please use the getAllTables() function of the Materialized Views Manager Service instead. For example:

$mviews = \Drupal::service('tripal_chado.materialized_views');
$all_mviews = $mviews->getTables();
Returns
An associative array where the key and value pairs are the table names.

◆ chado_get_mviews()

chado_get_mviews ( )

Retrieves the list of materialized view IDs and their names.

Deprecated:

Please use the getAllTables() function of the Materialized Views Manager Service instead. For example:

$mviews = \Drupal::service('tripal_chado.materialized_views');
$all_mviews = $mviews->getTables();
Returns
array An array of arrays with the following properties: mview_id, name.

◆ chado_populate_mview()

chado_populate_mview (   $mview_id)

Populates a Materialized View.

Parameters
$mview_idThe unique identifier for the materialized view to be updated.
Returns
True if successful, FALSE otherwise.

◆ chado_refresh_mview()

chado_refresh_mview (   $mview_id)

Submits a Tripal job to populate the specified Materialized View.

Parameters
$mview_idThe unique ID of the materialized view for the action to be performed on.