function tripal_db_set_chado_search_path

1.x tripal_core_chado.api.inc tripal_db_set_chado_search_path($dbname)

Set the chado search_path for PostgreSQL

Sets the database search_path for postgreSQL to the chado schema.

Related topics

2 calls to tripal_db_set_chado_search_path()
tripal_db_set_active in tripal_core/api/tripal_core_chado.api.inc
Set the Tripal Database
tripal_views_views_pre_execute in tripal_views/tripal_views.views.inc
Implementation of hook_views_pre_execute().

File

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

Code

function tripal_db_set_chado_search_path($dbname) {

  // check to make sure the chado schema exists
  $chado_exists = variable_get('chado_schema_exists', FALSE);
  if (!$chado_exists) {
    $chado_exists = tripal_core_chado_schema_exists();
  }

  // here we make the assumption that the default database schema is
  // 'public'.  This will most likely always be the case but if not,
  // then this code will break
  if ($chado_exists) {
    db_query('set search_path to %s', "$dbname,public");
    return TRUE;
  }
  else {
    return FALSE;
  }
}