function tripal_core_chado_schema_exists

2.x tripal_core.DEPRECATED.api.inc tripal_core_chado_schema_exists()
3.x tripal_core.DEPRECATED.inc tripal_core_chado_schema_exists()
1.x tripal_core_chado.api.inc tripal_core_chado_schema_exists()

Check that the Chado schema exists within the local database

Return value

TRUE/FALSE depending upon whether it exists

13 calls to tripal_core_chado_schema_exists()
tripal_analysis_views_default_views in tripal_analysis/tripal_analysis.views.inc
Implements hook_views_default_views().
tripal_core_is_chado_installed in tripal_core/api/tripal_core_chado.api.inc
Check whether chado is installed (either in the same or a different database)
tripal_core_set_chado_version in tripal_core/api/tripal_core_chado.api.inc
Sets a Drupal variable with the current version of Chado. This variable can then be queried later using the tripal_core_get_chado_Version
tripal_db_set_chado_search_path in tripal_core/api/tripal_core_chado.api.inc
Set the chado search_path for PostgreSQL
tripal_featuremap_views_default_views in tripal_featuremap/tripal_featuremap.views.inc

... See full list

File

tripal_core/api/tripal_core_chado.api.inc, line 3392
The Tripal Core API

Code

function tripal_core_chado_schema_exists() {

  $exists = variable_get('chado_schema_exists', FALSE);

  if (!$exists) {
    // This is postgresql-specific code to check the existence of the chado schema
    // @coder-ignore: acting on pg_catalog schema rather then drupal schema therefore, table prefixing does not apply
    $sql = "SELECT nspname FROM pg_catalog.pg_namespace WHERE nspname = 'chado'";
    if (db_fetch_object(db_query($sql))) {
      variable_set('chado_schema_exists', TRUE);
      return TRUE;
    }
    else {
      return FALSE;
    }
  }
  return TRUE;
}