function chado_dbschema_exists

2.x chado_dbschema_exists($schema)

Check that any given schema exists.


$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

3 calls to chado_dbschema_exists()
tripal_core_install_sql in tripal_core/includes/
Execute the provided SQL
tripal_core_reset_chado_schema in tripal_core/includes/
Reset the Chado Schema This drops the current chado and chado-related schema and re-creates it
tripal_core_schema_exists in tripal_core/api/
1 string reference to 'chado_dbschema_exists'


tripal_core/api/, line 216


function chado_dbschema_exists($schema) {

  $sql = "
    SELECT nspname
    FROM pg_namespace
      has_schema_privilege(nspname, 'USAGE') AND
      nspname = :nspname
    ORDER BY nspname
  $schema = db_query($sql, array(':nspname' => $schema))->fetchField();
  if ($schema) {
    return TRUE;
  return FALSE;