function tripal_core_schema_exists

2.x tripal_core.DEPRECATED.api.inc tripal_core_schema_exists($schema)
3.x tripal_core.DEPRECATED.inc tripal_core_schema_exists($schema)
1.x tripal_core_chado.api.inc tripal_core_schema_exists($schema)

Check that any given schema exists

Parameters

$schema: The name of the schema to check the existence of

Return value

TRUE/FALSE depending upon whether or not the schema exists

Related topics

2 calls to tripal_core_schema_exists()
tripal_core_install_sql in tripal_core/includes/chado_install.inc
Execute the provided SQL
tripal_core_reset_chado_schema in tripal_core/includes/chado_install.inc
Reset the Chado Schema This drops the current chado and chado-related schema and re-creates it

File

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

Code

function tripal_core_schema_exists($schema) {

  // check that the chado schema now exists
  $sql = "SELECT nspname
         FROM pg_namespace
         WHERE has_schema_privilege(nspname, 'USAGE') and nspname = '%s'
         ORDER BY nspname";
  $name = db_fetch_object(db_query($sql, $schema));
  if (strcmp($name->nspname, $schema) != 0) {
    return FALSE;
  }

  return TRUE;
}