function chado_get_schema_name

3.x tripal_chado.query.api.inc chado_get_schema_name($schema = 'chado')

Retrieve the name of the PostgreSQL schema housing Chado or Drupal.

Parameters

$schema: Wehter you want the schema name for 'chado' or 'drupal'. Chado is the default.

Return value

The name of the PostgreSQL schema housing the $schema specified.

Related topics

15 calls to chado_get_schema_name()
chado_column_exists in tripal_chado/api/tripal_chado.schema.api.inc
Check that any given column in a Chado table exists.
chado_create_custom_table in tripal_chado/api/tripal_chado.custom_tables.api.inc
Add a new table to the Chado schema. This function is simply a wrapper for the db_create_table() function of Drupal, but ensures the table is created inside the Chado schema rather than the Drupal schema. If the table already exists then it will be…
chado_get_version in tripal_chado/api/tripal_chado.schema.api.inc
Returns the version number of the currently installed Chado instance. It can return the real or effective version. Note, this function is executed in the hook_init() of the tripal_chado module which then sets the…
chado_is_installed in tripal_chado/api/tripal_chado.schema.api.inc
Check whether chado is installed (either in the same or a different database)
chado_is_local in tripal_chado/api/tripal_chado.schema.api.inc
Check that the Chado schema exists within the local database

... See full list

File

tripal_chado/api/tripal_chado.query.api.inc, line 1990
Provides an API for querying of chado including inserting, updating, deleting and selecting from chado.

Code

function chado_get_schema_name($schema = 'chado') {

  // First we will set our default. This is what will be returned in most cases.
  if ($schema == 'chado') {
    $schema_name = 'chado';
  }
  else {
    $schema_name = 'public';
  }

  // There are cases where modules or admin might need to change the default
  // names for the schema. Thus we provide an alter hook here to allow
  // the names to be changed and ensure that schema names are never hardcoded
  // directly into queries.
  $context = array('schema' => $schema);
  drupal_alter('chado_get_schema_name', $schema_name, $context);

  return $schema_name;
}