function tripal_get_schema_name
2.x tripal_core.chado_query.api.inc | tripal_get_schema_name($schema = 'chado') |
3.x tripal_chado.DEPRECATED.api.inc | tripal_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 tripal_get_schema_name()
- chado_add_node_form_relationships_name_to_id_callback in tripal_core/
api/ tripal_core.chado_nodes.relationships.api.inc - Handles autocomplete for subject & object id
- chado_column_exists in tripal_core/
api/ tripal_core.chado_schema.api.inc - Check that any given column in a Chado table exists.
- chado_create_custom_table in tripal_core/
api/ tripal_core.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_core/
api/ tripal_core.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_core module which then sets the…
- chado_is_installed in tripal_core/
api/ tripal_core.chado_schema.api.inc - Check whether chado is installed (either in the same or a different database)
File
- tripal_core/
api/ tripal_core.chado_query.api.inc, line 1807 - Provides an API for querying of chado including inserting, updating, deleting and selecting from chado.
Code
function tripal_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('tripal_get_schema_name', $schema_name, $context);
return $schema_name;
}